Linux common commands and basic concepts

Source: Internet
Author: User

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

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.