In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Today, I would like to talk to you about the most practical Linux command Yunnan food that can be run in Windows 10, which may not be well understood by many people. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.
This article is for beginner developers who use Windows 10 but want to learn about Linux on Azure, AWS, or private cloud platforms. In other words, to help Windows 10 users who are new to the Linux system.
In earlier articles in this series, we discussed how to start a WSL journey on Windows 10. As an article in this series, we are going to explore some Linux commands that can be widely used on Windows 10.
Before we go any further, let's make clear who this tutorial applies to. This article is for beginner developers who use Windows 10 but want to learn about Linux on Azure, AWS, or private cloud platforms. In other words, to help Windows 10 users who are new to the Linux system.
Your task determines the commands you need, but my needs may be different from yours. This article is designed to help you use Linux comfortably on Windwos 10. Keep in mind, however, that WSL does not provide hardware access features, such as sound cards and GPU, at least officially. But this may not stop the spirit of Linux users. Many users have not only completed hardware access, but have even installed Linux desktop programs on Windows 10. But these are not covered in this article, and we may discuss them, but not now.
Here are the tasks we need to start with.
How to keep your Linux system at the * version
Because Linux runs on a Windows system, you will be deprived of all the security features provided by the Linux system. In addition, if you do not patch your Linux system in time, your Windows device will be forced to be exposed to external threats, so please keep your Linux version *.
WSL officially supports openSUSE/SUSE Linux Enterprise and Ubuntu. You can also install other distributions, but I only need one of them to do all my work; after all, I only need to access some Linux basic programs.
Update openSUSE Leap:
Sudo zypper up
If you want to upgrade the system, you can run the following command:
Sudo zypper dup
Update Ubuntu:
Sudo apt-get update sudo apt-get dist-upgrade
In this way, you are safe, because the update of the Linux system is gradual, so updating the system has become my daily routine. Unlike Windows 10 updates, which usually require a system restart, unlike Linux, there are generally only KB or MB-level updates, without rebooting.
Manage file directory
After the system update, let's take a look at some common or less common tasks.
The second most important task besides system updates is to use Linux to manage local and remote files. I admit that I prefer graphical interface programs, but terminals can provide more reliable and valuable services. Why don't you use Explorer to move 1 TB files? I usually use the rsync command to move a large number of files. If the task is interrupted, rsync can continue to work where it was last stopped.
Although you may be more accustomed to copying and moving files using cp or mv commands, I prefer flexible rsync commands, and understanding rsync is also helpful for remote file transfer. Most of rsync is used to accomplish the following three tasks:
Copy the entire directory using rsync:
Rsync-avzP / source-directory / destination directory
Use rsync to move files:
Rsync-- remove-source-files-avzP / source-directory / destination-directory
After successfully copying the destination directory, this command deletes the source file.
Use rsync to synchronize files:
My files may be stored in multiple places. However, I will only add or delete in the primary location. Synchronizing files can be challenging if you don't use professional software, and rsync can simplify the process. This command synchronizes the contents of the two directory files. Note, however, that this is an one-way synchronization, that is, from the source location to the destination location.
Rsync-- delete-avzP / source-directory / destination-directory
If no files are found in the source directory, the above command deletes the files in the destination directory. In other words, it creates a mirror of the source directory.
Automatic backup of files
Keeping a backup of files is a tedious task. To keep my device fully synchronized, I ran a cron job to keep all my directories in sync at night. But I keep an external drive, and basically I synchronize it manually once a week. I didn't use the-- delete option because I might delete files I didn't want to delete. I will manually decide whether to use this option or not depending on the situation.
Create a cron job and open crontab:
Crontab-e
When I move a large file, I choose to execute the command late at night when the system is idle. This command will be run at 1 o'clock every morning, and you can probably modify it like this:
# 0 1 * rsync-avzP / source-directory / destination-directory
This is the command structure for scheduled jobs using crontab:
# m h dom mon dow command
Here, m = minutes, h = hours, dom = some day of the month, mon = month, dow = some day of the week.
We will run this command at 1 o'clock every morning. You can choose dow or dom (for example, the 5th of each month) and so on.
Manage remote servers
One of the advantages of using WSL on Windows systems is that it is easy to manage Linux servers on the cloud. WSL can provide you with native Linux tools. First, you need to log in to the remote Linux server using the ssh command.
For example, my server ip is 192.168.0.112; port is 2018 (not the default port 22); the Linux user name is swapnil, and the password is "I won't tell you".
Ssh-p2018 swapnil@192.168.0.112
It asks you for the user's password, and then you can log in to the Linux server. Now you can do whatever you want on the Linux server. You don't need to use the PuTTY program.
With rsync, you can easily transfer files between a local machine and a remote machine. Depending on whether you upload the file to the server or download the file to a local directory, you can use username@IP-address-of-server:/path-of-directory to specify the directory.
If I want to copy some text to the server's home directory, the command is as follows:
Rsync-avzP / source-directory-on-local-machine 'ssh-p2018' swapnil@192.168.0.112:/home/swapnil/Documents/
This will copy these files to the Documents directory on the remote server.
After reading the above, do you know more about Yunnan cuisine, the most practical Linux command that can be run in Windows 10? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.