Linux Common commands

Source: Internet
Author: User

Specific Linux commands:
1.who: Displays information about users logged into the system; Tty7 graphical interface; user logon time
2.PWD: the current path; 1./: The location representing the start of the file system
2. Path: A string representing a file or directory
3.ls: View the file or sub-directory information of the specified target directory;
Common options:-L (Long) to display list details as a list
-a displays all files and folders (files at the beginning of the point are hidden)
ls+la+ Relative path: view
4. Path: 1. Absolute path: The path that begins with the root is the absolute path;
Example: Absolute path:/home/tarena/aid0801/
2. Relative path: A path that does not begin with a root is a relative route.
. : Current Folder
.. : Parent folder (directory)
~: Household directory (/home/tarena)
(shortcut key) 1.ctrl+c terminate this command; ctrl+l,clear clear screen
2. Adjust the terminal font: ctrl+shift+ plus to enlarge;
Zoom out: Ctrl + MINUS sign;
Ctrl+alt+enter, exit full screen;
Launch terminal: Exit;
Shutdown: Init 0/reboot/shutdown-n new
Restart: Init 6 abort command run: Ctrl + C
5.CD: Switch working directory/enter into a directory;
CD directory name (the directory name can be an absolute path/relative path)
Example: CD. : Default back:/home/tarena back to User home directory
Example 2:CD-: Switch back and forth in the last two directories visited.
6.mkdir: Create one/More folders
Command format: mkdir option command name folder 1 folder 2 and so on
Example: mkdir a b C
Common options:-P option to create multiple directories recursively (created directly if the middle folder does not exist)
Touch: Create one or more files (touch filename 1 filename 2 filename 3 ....) )
Cat: View file contents; Format: Cat file name.
RM Delete (remove abbreviation) is the function of deleting one or more files or folders;
Common Options-r: Delete files and folders (contains all the contents of the folder)
-F: Force delete, without giving any hint
-I: Prompt before deletion (yes means y,no = N)
Note: Use this command with caution in a production environment: RM-RF Delete all Files
(Do not delete files with absolute path) RM-RF: File/filename
Skill class: 1. Be good at using TAB key to auto-complement
2. Historical order
In the terminal window can be used, the next key to find the command has been executed
3.history
! Sequence number--execute command
1. Wildcard characters:
Match any number of characters (all)
? Match an arbitrary character; example: ls . TXT view all files ending in txt
RM-RF
. txt delete all files ending with. txt
2.linux Chinese text editor Vim/vi (equivalent to Notepad in Windows)
1. Format: VI file name
2. How to edit: Vim three modes of Operation 1. Normal mode (mode to enter after starting)
2. Insert mode (text can be edited in this mode)
3. Command-line mode
3. Text-Writing steps:
1.VI file name
2. Normal mode? Insert mode
A: Insert to the right of the current cursor
I: Insert in front of the current cursor
O: The next line of the current cursor is inserted
3. Press ESC with insert mode to switch to normal mode
4. Normal mode switch to command line mode shift+:
5. Under command line, enter the following: W save; Wq: Save and exit;
Q: Do not save the exit; q! forced exit
"YY": the line where the cursor is copied; 5YY copy 5 rows
P: Paste to the next line where the cursor is located
DD: Delete/cut cursor line: 7DD
U: Fallback
Copy: CP: Copy files or directories used
Format: Copy file CP source file destination file
Copy directory cp-r directory 1 directory 2
MV Action 1. Clipping: MV file name 1 path/{file name 2}
Mv file name 1 path/{directory name 2}
function 2 rename; format mv file name 1 file name 2 (file)
MV Directory name 1 directory Name 2
Cat: View File contents
Format: Cat file name; example: CAT/ETC/PASSWD;
MORE: Split screen view file contents
Common actions: SPACEBAR: Turn to the next screen
Enter: Turn to the next line to display
Format: More ETC/PASSWD

Linux Common commands

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.