Linux Primary OPS Command summary

Source: Internet
Author: User

Linux command Daquan:
Command format: command LS [parameter]-l [path file]/

Summary of COMMON commands:

Mkdir
Create a new directory (-p recursively create mkdir-p/data)

Cd
Go to directory (CD-Return to most recent directory cd~ home directory)

Pwd

To view the current path:
Ls
Show files or directories (-l Long format view,-D view directory,-a show hidden files, start with.)

Echo
Print out content (Printf-format and print data)

Vi/vim
Edit file (Command mode: wq/q/q!/wq!) W write Q quit! mandatory
(insert mode: a/o/i)
ESC Toggle Command Mode
: Set nu display line number, DD Delete current line, YY copy current line, p paste
Line number +gg Navigate to the row
G or shfit+g: Switch to end of file GG to file header

Cat
View the contents of a file (displayed sequentially from the first line) cat-n Display line numbers
Cat>>a.txt<<eof append multiple lines of text (append 1234556 abcdefg to a.txt end)
1234556
Abcdefg
Eof

Tac
Invert file contents (reverse display from the last line)

Cp
Copy file or directory (-r copy directory,-A=DPR)-A Save File property

Mv
Rename (rename command) or cut file directory

Rm
Delete a file or directory (-fr directory or file)

RmDir
Delete Empty Directory

Touch
Create a new file

Head
Header display file first 10 rows (-Number of rows-n rows)

Tail
Tail Display file 10 lines (-line number-N lines) (-F Trace File tail change)
[[email protected] ~]# for n in seq 100 ;d o echo $n >>/root/c.txt;sleep 1;done &
For loop: In the background execution at 1 seconds to the C.txt file write 1-100 increments, (command followed by & for background execution)
[1] 9281
[Email protected] ~]# tail-f c.txt
1
2
3
4

Grep
(filter string) The old three of the Three Musketeers
-V Exclusion
-e Filters multiple strings simultaneously (EGREP)
-I ignores case

Egrep
Equivalent to GREP-E

Sed
(Take all kinds of content, take the best of the line) The Three Musketeers ' dick
-N cancels the default output
-P Printing (print)
-D Delete (delete)

Alias
Display Settings Alias

Unalias
Cancel Alias

which
View the path where the command is located (whereis,locate,find)

Find
Find command
-type (f file D) Find by file type
-name "A" Search by name
-mtime Search by modified time

Tree
(-l View directory structure)

Xargs
For the find/ls of the oh-oh output to the back processing

Seq
-s Specifies the delimiter to print the number sequence echo {1..5}

Mans
Help commands for viewing commands and configuration files, etc.

Touch
Create a file or modify a file timestamp

Pwd
View current Path

History
View historical records
-C Clear All
-D line number View the history of the brake line number

Diff
Compare file content differences (compare files line by line) < vimdiff>

Useradd
Add user

passwd
Modify the user password (if you do not specify the user, then modify the current user password, ordinary users can only change their own password)

WhoAmI
View current command line end user

W
View the currently logged on user

Su
Switch user roles, take care to bring up-

Sudo
Allows a normal user to have the permissions of the specified user root

Yum
Package Manager to resolve RPM package dependencies

Rmp
-IVH Software Installation Commands

Chkconfig
View the command to set up automatic software for booting

Netstat
View network status Lntup or an

Lsof
-I "Prot View port

Chattr
Lsattr

Sort
Sort lines of text-n (representing numbers)

Linux Primary OPS Command summary

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.