Linux Common directives

Source: Internet
Author: User
Tags bz2 clear screen create directory save file

directory structure:1)/Bin directory: Bin is the abbreviation for binary binary in English, which holds system commands2)/Dev directory: Dev is an abbreviation for English device devices that contains special files for all the devices supported by the system, such as a printer terminal tape disk display, and so on3)/etc Directory: etc for the French et cetera, meaning "et cetera", the directory contains system commands and some for the system configuration file4/lib Directory: LIB is an abbreviation for the English Library, which mainly stores the system's link library files and does not work properly without the directory system. /The Lib directory holds the shared library used by the program when it is running, and many programs can use the same Code5)/tmp directory: TMP is an abbreviation for English temporary, which is used to hold temporary files6)/usr directory: USR is an abbreviation for English user, which contains all the shared files and programs------------------------------------------------------------------------------------------------------Common Directives------------------------------------------------------------------------------------------------------ls display file or directory-L list File details (list)-a lists all files and directories in the current directory (all)------------------------------------------------------------------------------------------------------mkdir Creating a directory-p Create directory, if no parent directory, create p (parent)------------------------------------------------------------------------------------------------------CD Switch directory: Switch to the previous level directory of the current directory~Switch to home directory-switch to pre-access directory------------------------------------------------------------------------------------------------------PWD Displays the current directory find DIR1 searches the specified directory for the specified file CP Dir1/file.txt dir2 Copy (copy and paste) MV Dir1/file.txt dir2 Cut or rename file rm Delete file-r Delete subdirectories and files-F Force Delete------------------------------------------------------------------------------------------------------Touch Create empty file cat file.txt view file Contents VI                                                Edit the file (if not the file is created and edited)VI into the editing interface after I                                                Insert a from the front of the first character and insert a from the back of the first character Inserts the ESC key from the back of the last character in the first line+: Wq exit Edit and save file: Wq file.txt save file named File.txtesc key +: q!(do not save) exit edit grep SS tmp1.txt Query file Tmp1.txt contains SS lines ------------------------------------------------------------------------------------------------------WC Statistics Bytes, number of words, Columns-C or-bytes or-chars Show only bytes number-L OR-lines displays only the number of columns-L Print the length of the longest line. -W OR-words only display words-version displays release information-Help online EG1:WC testfile testfile_1 testfile_2 #统计三个文件的信息3         the 598testfile #第一个文件行数为3, number of words 92, number of bytes 598 EG2:WC testfile testfile_1 testfile_2 #统计三个文件的 Information3         the 598testfile #第一个文件行数为3, number of words 92, number of bytes 5989      -   +Testfile_1 #第二个文件的行数为9, number of words 18, number of bytes3       6   +testfile_2 #第三个文件的行数为3, number of words 6, number of bytes the  the 708Total usage #三个文件总共的行数为15, number of words 116, number of bytes 708------------------------------------------------------------------------------------------------------LN Creates a linked file-B will back up files that are overwritten or deleted at the time of the link-F Chaining the file with the same file name is deleted and then created-I ask before replacing the original file name-s for soft link (symbolic link)-v show its file name before linking-n when making a soft link, link is treated as a generic file-S SUFFIX To add the backed up files with SUFFIX tails-V method Specifies how the backup is--Help Display Auxiliary instructions--version Show versions rm-RF linkname Delete link------------------------------------------------------------------------------------------------------More , less pagination display text file content head, tail display file header, tail content Ctrl+alt+F1 command line full-screen mode------------------------------------------------------------------------------------------------------Packaging Compression Related instructions------------------------------------------------------------------------------------------------------gzip gzip compression format BZIP2 bzip2 compressed format tar Compression/Unzip-C Archive File-x Compressed Files-z gzip Compressed Files-J bzip2 Compressed Files-v Show compression or decompression process-f using the document name EG1: Compress file tar-CVF Tmp.tar Tmp1.txt only package does not compress tar-ZCVF tmp.gz tmp1.txt Package and gzip compress tar-JCVF tmp.bz2 tmp1.txt Pack and bzip2 compress EG2: Unzip the file tar-XVF Tmp.tartar-ZXVF Tmp.gztar-JXVF tmp.bz2------------------------------------------------------------------------------------------------------System Instructions------------------------------------------------------------------------------------------------------who shows online login user WhoAmI show current action                                              User Stat Displays detailed information about the specified file (more detailed than LS) unname                                                  Display System Information top dynamically displays the process information PS that currently consumes the most resources Show transient process status-aux display all instantaneous process status du view directory size (default bytes) -h (k,m,g)-A View all directory sizes-B bytes-K KB, less than 1KB in 1, such as 3300b--->4k-m MB, less than 1MB in 1, such as 8.9m--->9m------------------------------------------------------------------------------------------------------ifconfig View network condition ping IP Test network connectivity NE                                               Tstat Display network status information kill kill process Clear Clear Screen------------------------------------------------------------------------------------------------------shutdown-R shut down restart-h shutdown does not restart-now immediately shut down the halt off the machine reboot restart------------------------------------------------------------------------------------------------------

Linux Common directives

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.