Summary of Common commands in liunx and summary of liunx commands

Source: Internet
Author: User

Summary of Common commands in liunx and summary of liunx commands

This article may be of little use for many years of work, but it will certainly be helpful for those who have just come into contact with Java. Now I summarize some common commands that I have come into contact with liunx.

1: Common log query commands

Ll: Query all files in the directory

Ls-lht: query the size of all files in the directory

Cd: Switch different directories

The tail-100f Log File prints one hundred logs (100 can be changed based on actual conditions)

Tail-100f Log File | grep-100i 'error ': group query I is case insensitive 'error'. All the keyword 100 with error in the query log file indicates the 100 rows of records related to the error.

Cat Log File | grep-100i 'error' is basically similar to the above, except that cat searches and matches the log file from the beginning to the end.

Rz-be: upload a file to the liunx command

Sz: File Download command from liunx

Sh-x file: Execution File Content

2: Common commands for file operations

Mkdir folder name: Create a folder

Rm-f: Command to delete a file (for example, rm-f * deletes all rm-f fileName.txt deletes a single file)

Rm-rf: delete directory

Tar czvf compressed file. tar original file: compressing a single file

Tar czvf compressed file. tar original file 1, original file 2...: compress multiple files

Tar czvf compressed file. tar Directory: compressing a single directory

Tar czvf compressed file. tar Directory 1, directory 2...: compressing multiple directories

Tar xzvf compressed file. tar decompress the file

Unzip file. zip: Decompress the zip file

Gunzip file .gz: Decompress the gz file cp-r file name Backup Directory: backup file mv original file rename file: file rename chmod + x: file with Operation permissions 3: common text editing commands

Vi: Enter the editing page

I: editing files

: Q: Exit

: Q! : Force exit

: Wq: Save and exit

4: Common commands for text merging and deduplication

Cat: Read text

Uniq: deduplication command

Sort: sorts text.

Practical Application

Cat file1.txt file2.txt> file3.txt Merge files (the first file is stored in the next file)

Paste file1.txt file2.txt> file3.txt Merge files (one on the left is on the slave)

Sort file | only one row with uniq record

Sort file | remove all repeated uniq-u rows

5: disk-related commands

Please refer to this article (Disk command)

 

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.