Common linux commands

Source: Internet
Author: User

Common linux commands

Common commands:
1. view the Directory: ls
Ls-a contains Hidden Directories
Ls-l displays detailed information.-starts with file d and starts with directory
Blue is the Directory
Green: Executable File
Black (white): normal file
2. See help:
Man command name
Q exit
3. view the current directory:
Which directory does pwd look?
4. Enter the Directory
Cd directory name
Absolute directory/
Relative directory. Current directory... parent directory

5. Go to the super directory
Root

Operation file:
1. create directory: mkdir directory name
2. Copy: cp source (absolute or relative) Target (file or directory)
Cp-r source (can be absolute, can be relative) Target (can be a file, can be a directory) if it does not exist, create, if it exists, go to the test
3. Mobile: mv Source Target
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
Delete a file instance:
Rm-f/var/log/httpd/access. log
The file/var/log/httpd/access. log will be forcibly deleted.

VI:
1. vi file name open this file with vi (If yes, open it, if no)
2. Write files
Insert the I table above
Insert table a following
3. Click esc to exit the editing mode.
Enter the colon
: W save
: Wq save and exit
: Q! Exit Without saving (Force Exit)
4. esc, undo: u
5. Replacement character: r
6. Copy: copy a row from the 1yy 1 Table
Copy multiple rows: 10yy
Move the cursor to the specified row with the keyboard
Point p

7. paste: p

8. Search: // find the word from front to back n to find the next one
? The word to be searched goes forward from the back

9. Set the row number:
: Set number
10. Remove the row number:
: Set nonumber
11. Go to n rows:
105

12. Write files
Echo "hello, world"> a.txt
13. append write:
Echo "hello, world"> a.txt

14. view files
Cat a.txt

15. Completely clear the file
Move the cursor down to the last line
Input:
: 1,. d press ENTER

 

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.