What are the common commands and shortcuts in linux
Editor to share with you what the commonly used commands and keyboard shortcuts in linux are, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
1 system introduction 1. Ping format: ping [URL] # to determine whether the system can be connected to the network normally 2. Host login user information [root@localhost ~] # root: user name @: delimiter for logging in to the current system Localhost has no special meaning: hostname of the current system ~: current directory (~ represents the current home directory / root) #: no actual meaning 3. Custom system login user information PS1 environment variable [root@localhost ~] # echo $PS1 [\ u@\ h\ W]\ $[root@localhost ~] # PS1=' [\ u@\ h -\ W]\ $'
1.1 system command syntax format
Usually system command syntax format: command [parameter] [option] [path]
1.2 system directory structure
Everything in Linux starts with the root (/). Knowledge store: cd: switch directories
1.3 Type of system path
Absolute path: the reference is the root (/) path relative path: the reference is the current path
1.4 system run commands
1 、 Shutdown shutdown: shutdown or restart parameters:-h: specify the delay time for shutdown-c: cancel shutdown halt: disable CPU resource poweroff: power off init: set system startup mode 0: shutdown 1: single user mode 2: multi-user no network mode 3: multi-user mode 4: TBD 5: desktop mode 6: restart reboot 2, Restart reboot init shutdown parameter:-r: specify the delay time for restart
1.5 View system Command help
Format: man [commands that need to view help] Command explanation Information: NAME Command Syntax description Information: SYNOPSIS Command description details: DESCRIPTION Command parameters details: OPTIONS Q: exit / [search content]: search content 2 system shortcuts 1, Historical command information: arrow keys 2, clear screen command: ctrl + l | clear3, interrupt cancel command execution: ctrl + c4, quickly move the cursor to the beginning and end of the line: ctrl + a/e5, cut the cursor to the beginning of the line: ctrl + U6, paste the cut: ctrl + Y7, cut the cursor to the end of the line: ctrl + K8, lock the system window information status: ctrl + S9, unlock the system window information status: ctrl + Q10, Quickly move the cursor on the command line: ctrl + key 11, system command information completion function: tab
3 common system commands
3.1 commands related to directory path
1. Display current path information pwd 2, switch directory path information cd special path: 1, -: last access path 2. Represents the current path 3,.. : upper layer path 4, ~: home directory absolute path and relative path 3, Perform directory creation operation mkdir parameter:-p: automatically create parent directory-v: display the process of creating a folder case: required in the upper directory under the data directory Create a v1 directory in the test directory [root@localhost ~] # mkdir-p.. / data/test/v1 Note: when mkdir creates a folder The directory above this folder must exist
3.2 commands related to file directory
1. Create file information command touch [root@localhost ~] # touch 1.txt 2, View data information command ls to view the file information in the specified directory, and view the file information in the current directory by default. Parameter:-l: show file details-a: show hidden folders (with. The first file or folder is called a hidden folder)-h: format file size (must be used with the-l parameter) [root@localhost ~] # ls-l total 4-rw-r--r--. 1 root root 0 Dec 9 12:15 1.txt-rw-r--r--. : file permissions 1: file hard links root: user root: group 0: size (bytes) Dec 9 12:15: time created 1.txt : file name 1B = > 8 bytes 1024 bytes = 1kB 1024kb = 1MB 3, Output print character information echo override redirection (>): delete everything in the file and then write the overweight direction (> >): write information at the end of the file 4. View file data information cat [need to view the path of the file] these are all the contents of the article "what are the common commands and shortcuts in linux" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!