Linux Command Encyclopedia

Source: Internet
Author: User
Tags bz2 chmod clear screen compact readable file permissions

1. Quick Start Terminal: ctr+alt+t
2. Terminal font enlargement: ctr+shift+ ' + '
3. Terminal font reduction: ctr+ '-'
4. LS: View the file information in the current directory
4.1 ls BD ABC view two directories at a time
5. PWD: View the directory path
6. Touch: Create a file
6.1 Touch 1.txt 2.txt Simultaneous creation of two files
7. mkdir: Create a folder
8. RmDir: Delete Empty folders
9. RM: The default is to delete files, delete folders can use the-r option,-r: Recursively delete all files in the folder
CD: Switch directories
10.1 CD directory Name: Switch to the specified directory
10.2 CD: Switch to the previous level directory
10.3 CD.: Switch to the current directory
10.4 CD ~: Switch to the user's working directory
10.5 cd = CD ~: Switch to the user's working directory
10.6 CD-: Switch to previous directory
Clear: Clear screen, Window--CLS
12. Absolute path: The path from the root directory is called the absolute path, for example:/home
13. Relative path: The path from the current directory is called relative path, hint: relative path can be relative to their own directory to look up, you can also look down, such as:. /test,./test
14. Auto Completion: Press two times TAB key, for example: when the CD switch directory
CP: Copy
15.1 CP file name path: Copy the file to the specified path
15.2 cp filename Path/new file name: Copy the file to the specified path and then modify it to a new file name
15.3 cp Folder path-r: Copy folder-r: Recursively copy all the files in the folder
15.4 CP filename New file name: Copy the file to the current directory and change it to a new file name
MV: Move (cut)
16.1 mv filename Path: Move the file name to the specified path
16.2 mv filename Path/new name: Move the file to the specified path and then modify it to a new file name
16.3 MV filename New file name: rename
16.4 mv Folder path: Move the file to the specified path
* Tree: View file information as a directory tree
17.1 Tree/: View the directory trees file information for the specified directory (root directory)
Cal: View Calendar
18.1 cal-y: View year-round calendar
Date: Current time
19.1 Date "+%y:%m:%d%h:%m:%s": Display the time format is the day of the month and seconds
History: View Historical commands
20.1! Number of historical commands: Execution history command
21. Format of the terminal command:
21.1 command name option parameter: The habitual option is placed after the parameter, but in some cases it is not possible, for example: The Scp-r command is followed by an option
21.2 options: There may be 0 or more, such as:-R
21.3 parameter: The parameter may be a file name or a path, the parameter may have 0 or more

22. Command--help: View Help for commands
The. Man command
23.1 F means next page
23.2 B means previous page
23.3 Enter indicates the next line
23.4 Q indicates exit
RM option
Rm-i: to remind before deleting
Rm-r: Recursively Delete
RM-F: Deleting files that do not exist does not have an error alert
rm-d: Delete Empty directory
Rm-v: Displays post-deletion description information
. LS option
25.1-l: Display as a list
25.2-h: Displays the file size units
25.3-a: Show hidden files
-LL = > Ls-al
LS, L-
. mkdir Options
28.1-p: Create the folder you depend on in advance.
. CP Options:
29.1-i: Display Reminder Message
29.2-v: Shows the path description after the copy
29.3-r: Copying a folder in a recursive manner
29.4-F: Direct Coverage

The MV option
30.1-i: Display Reminder Message
30.2-v: Shows the path description after the move
30.3-F: Direct Coverage
31. Redirect (>,>>): Re-specify the direction of display, the contents of the terminal display to the file, later to view the data in the file to view
31.1: If the file exists, the data inside the original file is emptied and then the new data is written
31.2 >>: If the file exists it will be appended on the basis of the original file data
Summary: ls, tree, cat
Gedit: Commands for text editing tools: readable and writable
Cat: View the contents of a file at the terminal, read-only and cannot be edited
MORE: Split-screen display
34.1 F Space: Take a look at the next page
34.2 B: Look at a page, remind: if the combination of pipes using a page will work.
34.3 Enter: Look at the next line
34.4 exit: Q
35. |: Pipeline: A container that can be understood as storing data
Summary: LS, tree
36. File Merging
36.1 cat 1.txt 2.txt > 3.txt


37. Links
37.1 Soft Links: Like the corresponding shortcut, if the source files deleted through the soft link can not find the corresponding file data, hint: Create a soft connection does not add 1 to the number of hard links
37.2 Hard Link: Remove the original by hard-link file still can get the data of the file, like a person has more than one name, a name is not used can also use other names to find this person, hint: Create a hard connection to the hard connection data plus 1
37.3 ln-s 1.txt 1-s.txt: Creating a soft link
37.4 LN 1.txt 1-h.txt Creating a hard link
37.5: Summary: Soft links can be created for directories, but hard links cannot be created for directories
37.6: Pit Point Summary: If you create a soft link and the original file is not in the same directory, then the original file should use absolute path, hard links created in other directories will not have the data can not find the problem


. grep: Find in files based on specified content
38.1:-N: Display line number
38.2:-I: Ignore case
38.3:-V: Based on content
38.4: summary: Supports regular expressions, supported regex:. , ^, $, [ABC]
Find: Finding files in a specified directory
39.1-name: Indicates search by file name
39.2-size: Based on file size to find, less accurate
39.3-perm: Search by file permissions
39.4: Summary: Support wildcard characters *,?, wildcards play the role of fuzzy query
. LS:
40.1 You can enumerate the files displayed according to the wildcard character summary: Wildcard *,?, reminder: Wildcards do not put in double quotes
A. Tar package
41.1 TAR-CVF Test.tar *.txt Package The file into the specified package name, notice that the space does not become smaller
42.2-c: Means package,-V: Show packaged file-F: Specify package name, note:-F option must be placed after all options
. gzip compression
Gzip Test.tar-Test.tar.gz Compression pack
Tar packaging and compression (must be mastered)
43.1 TAR-ZCVF test.tar.gz *.txt Compression pack
*. gzip uncompressed
Gzip-d test.tar.gz Package
A. Tar unpacking
TAR-XVF Test.tar, get the files inside the package
*. Tar decompression and unpacking (must be mastered)
TAR-ZXVF test.tar.gz, extracting and unpacking files
BZ2 Compressed Package
TAR-JCVF test.bz2 *.txt. BZ Compression Pack
BZ2 Decompression and unpacking
TAR-JXVF test.bz2-File
TAR-JXVF test.bz2-c BBB-so file,-C after decompression path
. zip Archive Package
Zip test[.zip suffix Optional] *.txt test.zip Compact Package
Unzip decompression and unpacking
Unzip Test.zip-File
Unzip test.zip-d CCC, unzip to the specified directory
Summary: Zip compression format takes up the most space
chmod: Permissions to modify files
51.1 user role: U: Current user g: Same group of users o: Other User A: all users
51.2 Permissions: R (4) readable, W (2) writable X (1) executable-(0)
51.3 setting different users different permissions using the letter method chmod U=R,G=W,O=RW 1.txt
51.4 all user rights are readable and writable executable: chmod a=rwx 1.txt
51.5 all users do not have permission: chmod a=-1.txt or chmod a= 1.txt
51.6 digital law without authority chmod 1.txt
51.7 Digital method set different users different permissions chmod 461 1.txt
51.8 number method setting all users have all permissions: chmod 777 1.txt
Which: View the path where the command is located
Sudo-s: Switch to Admin user, prompt: If you need to install a certain software to use the administrator's permission can be followed by the command to add sudo apt-get install SL
Whami: Show Current user
Who: Users who log on to this computer
passwd: Change Password
. Exit: Exit
58. Update the image source: sudo apt-get update
The list of installation packages is displayed in the APT list.

1. Quick Start Terminal: ctr+alt+t
2. Terminal font enlargement: ctr+shift+ ' + '
3. Terminal font reduction: ctr+ '-'
4. LS: View the file information in the current directory
4.1 ls BD ABC view two directories at a time
5. PWD: View the directory path
6. Touch: Create a file
6.1 Touch 1.txt 2.txt Simultaneous creation of two files
7. mkdir: Create a folder
8. RmDir: Delete Empty folders
9. RM: The default is to delete files, delete folders can use the-r option,-r: Recursively delete all files in the folder
CD: Switch directories
10.1 CD directory Name: Switch to the specified directory
10.2 CD: Switch to the previous level directory
10.3 CD.: Switch to the current directory
10.4 CD ~: Switch to the user's working directory
10.5 cd = CD ~: Switch to the user's working directory
10.6 CD-: Switch to previous directory
Clear: Clear screen, Window--CLS
12. Absolute path: The path from the root directory is called the absolute path, for example:/home
13. Relative path: The path from the current directory is called relative path, hint: relative path can be relative to their own directory to look up, you can also look down, such as:. /test,./test
14. Auto Completion: Press two times TAB key, for example: when the CD switch directory
CP: Copy
15.1 CP file name path: Copy the file to the specified path
15.2 cp filename Path/new file name: Copy the file to the specified path and then modify it to a new file name
15.3 cp Folder path-r: Copy folder-r: Recursively copy all the files in the folder
15.4 CP filename New file name: Copy the file to the current directory and change it to a new file name
MV: Move (cut)
16.1 mv filename Path: Move the file name to the specified path
16.2 mv filename Path/new name: Move the file to the specified path and then modify it to a new file name
16.3 MV filename New file name: rename
16.4 mv Folder path: Move the file to the specified path
* Tree: View file information as a directory tree
17.1 Tree/: View the directory trees file information for the specified directory (root directory)
Cal: View Calendar
18.1 cal-y: View year-round calendar
Date: Current time
19.1 Date "+%y:%m:%d%h:%m:%s": Display the time format is the day of the month and seconds
History: View Historical commands
20.1! Number of historical commands: Execution history command
21. Format of the terminal command:
21.1 command name option parameter: The habitual option is placed after the parameter, but in some cases it is not possible, for example: The Scp-r command is followed by an option
21.2 options: There may be 0 or more, such as:-R
21.3 parameter: The parameter may be a file name or a path, the parameter may have 0 or more

22. Command--help: View Help for commands
The. Man command
23.1 F means next page
23.2 B means previous page
23.3 Enter indicates the next line
23.4 Q indicates exit
RM option
Rm-i: to remind before deleting
Rm-r: Recursively Delete
RM-F: Deleting files that do not exist does not have an error alert
rm-d: Delete Empty directory
Rm-v: Displays post-deletion description information
. LS option
25.1-l: Display as a list
25.2-h: Displays the file size units
25.3-a: Show hidden files
-LL = > Ls-al
LS, L-
. mkdir Options
28.1-p: Create the folder you depend on in advance.
. CP Options:
29.1-i: Display Reminder Message
29.2-v: Shows the path description after the copy
29.3-r: Copying a folder in a recursive manner
29.4-F: Direct Coverage

The MV option
30.1-i: Display Reminder Message
30.2-v: Shows the path description after the move
30.3-F: Direct Coverage
31. Redirect (>,>>): Re-specify the direction of display, the contents of the terminal display to the file, later to view the data in the file to view
31.1: If the file exists, the data inside the original file is emptied and then the new data is written
31.2 >>: If the file exists it will be appended on the basis of the original file data
Summary: ls, tree, cat
Gedit: Commands for text editing tools: readable and writable
Cat: View the contents of a file at the terminal, read-only and cannot be edited
MORE: Split-screen display
34.1 F Space: Take a look at the next page
34.2 B: Look at a page, remind: if the combination of pipes using a page will work.
34.3 Enter: Look at the next line
34.4 exit: Q
35. |: Pipeline: A container that can be understood as storing data
Summary: LS, tree
36. File Merging
36.1 cat 1.txt 2.txt > 3.txt


37. Links
37.1 Soft Links: Like the corresponding shortcut, if the source files deleted through the soft link can not find the corresponding file data, hint: Create a soft connection does not add 1 to the number of hard links
37.2 Hard Link: Remove the original by hard-link file still can get the data of the file, like a person has more than one name, a name is not used can also use other names to find this person, hint: Create a hard connection to the hard connection data plus 1
37.3 ln-s 1.txt 1-s.txt: Creating a soft link
37.4 LN 1.txt 1-h.txt Creating a hard link
37.5: Summary: Soft links can be created for directories, but hard links cannot be created for directories
37.6: Pit Point Summary: If you create a soft link and the original file is not in the same directory, then the original file should use absolute path, hard links created in other directories will not have the data can not find the problem


. grep: Find in files based on specified content
38.1:-N: Display line number
38.2:-I: Ignore case
38.3:-V: Based on content
38.4: summary: Supports regular expressions, supported regex:. , ^, $, [ABC]
Find: Finding files in a specified directory
39.1-name: Indicates search by file name
39.2-size: Based on file size to find, less accurate
39.3-perm: Search by file permissions
39.4: Summary: Support wildcard characters *,?, wildcards play the role of fuzzy query
. LS:
40.1 You can enumerate the files displayed according to the wildcard character summary: Wildcard *,?, reminder: Wildcards do not put in double quotes
A. Tar package
41.1 TAR-CVF Test.tar *.txt Package The file into the specified package name, notice that the space does not become smaller
42.2-c: Means package,-V: Show packaged file-F: Specify package name, note:-F option must be placed after all options
. gzip compression
Gzip Test.tar-Test.tar.gz Compression pack
Tar packaging and compression (must be mastered)
43.1 TAR-ZCVF test.tar.gz *.txt Compression pack
*. gzip uncompressed
Gzip-d test.tar.gz Package
A. Tar unpacking
TAR-XVF Test.tar, get the files inside the package
*. Tar decompression and unpacking (must be mastered)
TAR-ZXVF test.tar.gz, extracting and unpacking files
BZ2 Compressed Package
TAR-JCVF test.bz2 *.txt. BZ Compression Pack
BZ2 Decompression and unpacking
TAR-JXVF test.bz2-File
TAR-JXVF test.bz2-c BBB-so file,-C after decompression path
. zip Archive Package
Zip test[.zip suffix Optional] *.txt test.zip Compact Package
Unzip decompression and unpacking
Unzip Test.zip-File
Unzip test.zip-d CCC, unzip to the specified directory
Summary: Zip compression format takes up the most space
chmod: Permissions to modify files
51.1 user role: U: Current user g: Same group of users o: Other User A: all users
51.2 Permissions: R (4) readable, W (2) writable X (1) executable-(0)
51.3 setting different users different permissions using the letter method chmod U=R,G=W,O=RW 1.txt
51.4 all user rights are readable and writable executable: chmod a=rwx 1.txt
51.5 all users do not have permission: chmod a=-1.txt or chmod a= 1.txt
51.6 digital law without authority chmod 1.txt
51.7 Digital method set different users different permissions chmod 461 1.txt
51.8 number method setting all users have all permissions: chmod 777 1.txt
Which: View the path where the command is located
Sudo-s: Switch to Admin user, prompt: If you need to install a certain software to use the administrator's permission can be followed by the command to add sudo apt-get install SL
Whami: Show Current user
Who: Users who log on to this computer
passwd: Change Password
. Exit: Exit
58. Update the image source: sudo apt-get update
The list of installation packages is displayed in the APT list.

Linux Command Encyclopedia

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.