1 System Introduction1. Ping Format: ping [URL] # Determine whether the system can connect to the network normally 2. Host login user information [root@localhost ~]# root: User name for logging into the current system @: separator, no special meaning localhost: Host name of the current system ~: Current directory (~ represents the current home directory, /root) #: No actual meaning 3. Customize 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 The usual system command syntax format is: command [arguments] [options] [path] 1.2 System Directory Structure Everything in Linux starts from root (/). Knowledge reserve: cd : change directory 1.3 Types of system paths Absolute path: the reference is the root (/) path Relative path: the reference is the current path 1.4 System operation commands 1. Shutdown shutdown: Shutdown or restart Parameters: -h: Specify shutdown delay time -c: Cancel shutdown halt: Disable CPU resources poweroff: Turn off the power init: Set system startup mode 0: Shutdown 1: Single user mode 2: Multi-user no network mode 3: Multi-user mode 4: To be determined 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 [command to view help] Command explanation information: NAME Command syntax description: SYNOPSIS Command Description: DESCRIPTION Detailed description of command parameters: OPTIONS q : Exit /[Search content] : Search content 2 System shortcuts1. Historical command information: up and down keys 2. Clear screen command: ctrl + l | clear 3. Interrupt and cancel the command execution process: ctrl + c 4. Quickly move the cursor to the beginning and end of the line: ctrl + a/e 5. Cut the information from the cursor to the beginning of the line: ctrl + u 6. Paste the cut content: ctrl + y 7. Cut the information from the cursor to the end of the line: ctrl + k 8. Lock the system window information status: ctrl + s 9. Unlock system window information status: ctrl + q 10. Quickly move the cursor in the command line: ctrl + arrow keys 11. System command information completion function: tab 3 Common system commands3.1 Directory path related commands 1. Display current path information pwd 2. Switch directory path information cd Special paths: 1. -: the path last visited 2. .: represents the current path 3. ..: the previous path 4. ~: home directory Absolute path and relative path 3. Create a directory mkdir parameter: -p: Automatically create parent directories -v: Display the process of creating folders Example: Create a v1 directory in the test directory under the data directory in the previous directory [root@localhost ~]# mkdir -p ../data/test/v1 Note: When mkdir creates a folder, the parent directory of the folder must exist 3.2 File directory related commands 1. Create file information command touch [root@localhost ~]# touch 1.txt 2. View data information command ls View the file information in the specified directory. By default, the file information in the current directory is viewed. parameter: -l: Display detailed information of the file -a: Display hidden folders (files or folders starting with . are called hidden folders) -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: Number of file hard links root: User root: Group 0: Size (bytes) Dec 9 12:15 : created time 1.txt : file name 1B => 8 bytes 1024 bytes = 1kB 1024kb = 1MB 3. Output print character information echo Overwrite redirection (>): delete all the contents in the file and then write it Append redirection (>>): write information at the end of the file 4. View file data information cat [path to view the file] This is the end of this article about common commands and shortcut keys in Linux. For more relevant content about common Linux commands and shortcut keys, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: How to use CSS counters to beautify ordered lists of numbers
>>: How to operate the check box in HTML page
WeChat applet form validation, for your reference...
Today, I will answer these newbie questions: Build...
Basic Introduction In the previous article, we in...
We will use CSS3 animated transitions to create a...
Why is the title of the article “Imitation Magnif...
Automatically discover disks Configuration Key Va...
1. Create a repository in the specified directory...
Today I will introduce a very simple trick to con...
Log rotation is a very common function on Linux s...
Friends who are doing development, especially tho...
Sorting query (order by) In e-commerce: We want t...
This article shares the specific code of js to im...
Background: Make a little progress every day, acc...
Abstract: Many companies, even most companies whos...
Table of contents Effect display Component Settin...