Frequently review commands-general Linux technology-Linux technology and application information. The following is a detailed description. 1. Create a directory
Mkdir
NO1. create a multi-level directory in the current path
NO2. grant permissions to the newly created directory while creating the Directory
[Root @ rehat root] # mkdir-m 777 testmod
In this way, anyone has any permission for this directory.
2. Copy files and folders
Cp
NO1. copy the files in the specified directory to the current directory and rename
[Root @ rehat root] # cp ~ /. Bashrc bashrc_bak
NO2. force copy the file from the specified directory to the current directory, regardless of whether the current directory contains the file
[Root @ rehat root] # cp-f ~ /. Bashrc
NO2. copy the specified directory to the current directory
[Root @ rehat root] # cp-r/root/test.
[Root @ rehat root] # cp-r/root/test /.
The two have the same effect. When copying a directory, all the last-level directories in the source path will be copied, including the directory itself.
NO3. copy files from the specified directory to the specified directory
[Root @ rehat root] # cp ~ /. Bashrc/bak/. bashrc
NO4. during replication, all the attributes of the source file are also copied. If no parameter is specified, the properties of the target file and the source file may be inconsistent.
[Root @ rehat root] # cp-~ /. Bashrc/bak/. bashrc
NO5. if two folders need to be synchronized, one file is changed and the other file is changed, but ensure that the files of both files are up-to-date.
3. Create a link file, including hard links and soft links.
Ln
NO1. create a shortcut similar to Windows
[Root @ rehat root] # ln-s test.txt _ slnk
NO2. if you want to back up a file with insufficient space, you can create a hard connection for the file. In this way, even if the original file is deleted
If the linked file is not deleted, it is still not deleted in the bucket.
[Root @ rehat root] # ln-l test.txt _ hlnk
4. Mount and detach a File System
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service