Linux Common commands

Source: Internet
Author: User
Tags parent directory

Common commands:
1. View catalog: LS
LS-A contains hidden directories
Ls-l Show details,-start with file D as directory
Blue for Catalog
Green as an executable file
Black (white): Normal file
2. See Help:
Man command name
Q exit
3. Look at the current directory:
PWD to see under which directory
4. Enter the catalogue
CD Directory Name
Absolute Directory/
Relative directory. Current directory: Parent Directory

5. Go to the Super directory
Root

Operation Files:
1. Build directory: mkdir directory name
2. Copy: CP source (can be absolute, can be relative) target (can be file, can be directory)
Cp-r source (can be absolute, can be relative) the target (can be a file, can be a directory) if not exist then create, if present, go inside the test
3. Move: MV Source target
To delete a folder instance:
Rm-rf/var/log/httpd/access
The/var/log/httpd/access directory and all files and folders under it will be deleted
2
To delete a file usage instance:
Rm-f/var/log/httpd/access.log
This file will be forcibly deleted/var/log/httpd/access.log

VI:
1.VI file name Open this file with VI (open, none created)
2. Writing files
I table inserted in front
A table is inserted at the back
3. Click ESC to exit Edit mode
And then enter the colon
: W Save
: Wq Save Exit
: q! Do not save exit (Force exit)
4.esc, Undo: U
5. Replacement character: R
6. Copy: 1yy 1 Table Copy Row
Copy Multiple lines: 10yy
Cursor moves to the specified line with the keyboard
Point P Key

7. Paste: P

8. Find:/To find the word from the front back N find the next
The words to look for from the back forward

9. Set the line number:
: Set Number
10. Remove the line number:
: Set Nonumber
11. Go to N rows:
: 105

12. Writing Files
echo "Hello,world" > A.txt
13. Append Write:
echo "Hello, World" >> a.txt

14. View Files
Cat A.txt

15. Completely empty the file
Cut the cursor to the last line
Input:
: 1,.D Enter

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.