Copy
Copying of files CP copy of source file destination file folder CP -r source folder destination folder
Delete
Deleting Files RM File name Delete folder RM -rf Folder
View File types
File File name
Compression and decompression
Zip Unzip Unzip Compress the file to compress the zip destination file. Zip source folder
. Tar . GZ Decompression Tar zxvf tar source file compression tar z cvf the destination file. tar. GZ source Folder
. Tar . bz2 Decompression Tar JXVF Compressed file compression tar jcvf the target file. tar. bz2 source Folder
File identifiers
0 - standard input 1 - standard output 2 - Error output redirect output redirection > input redirection < Append write >> Use example merge two files to third file cat file1 file2 > file3 Note: Redirected output to a file can only be normal output, error output is normally Unable to write to the redirect file so how to tell the error message redirect to the file? ls2>out.txt plus 2, which means error output to OUT.txt file
Pipeline
The so-called pipeline, is the output of the previous command as input to the next command
ls -a| grep Vim
File permissions
chmod
Find
--regexp regular expression, support regular expression in Ubuntu Note: Locale does not directly look up files in the system (nonsense, otherwise it cannot be so fast), but instead reads a database (maintained by the system). Therefore, for a file that has just changed, it may not be found. UpdateDB is basically performed once a day. The remedy is to run the updatedb manually once, run find with sudo permissions to Find the contents of the specified folder find . Find . | grep . txt to find the TXT file in the current directory find . -Type F finds only files found . -type D only finds directories
Linux common commands and basic concepts