Linux commands and linux commands

Source: Internet
Author: User

Linux commands and linux commands
Linux commands

Linux commands
1. File Management
Cat Chattr Chgrp Chmod
Chown Cksum Cmp Diff
Diffstat File Find Git
Gitview Indent Cut Ln
Less Locate Lsattr Mattrib
Mc Mdel Mdir Mktemp
More Mmove Mread Mren
Mtools Mtoolstest Mv Od
Paste Patch Rcp Rm
Slocate Split Tee Tmpwatch
Touch Umask Which Cp
Whereis Mcopy Mshowfat Rhmask
2. document editing
Col Colrm Comm Csplit
Ed Egrep Ex Fgrep
Fmt Fold Grep Ispell
Jed Joe Join Look
Mtype Pico Rgrep Sed
Sort Spell Tr Expr
Uniq Wc    
3. file transmission
Lprm Lpr Lpq Lpd
Bye Ftp Uuto Uupick
Uucp Uucico Tftp Ncftp
Ftpshut Ftpwho Ftpcount  
4. disk management
Cd Df Dirs Du
Edquota Eject Mcd Mdeltree
Mdu Mkdir Mlabel Mmd
Mrd Mzip Pwd Quota
Mount Mmount Rmdir Rmt
Stat Tree Umount Ls
Quotacheck Quotaoff Lndir Repquota
Quotaon      
5. Disk Maintenance
Badblocks Cfdisk Dd E2fsck
Ext2ed Fsck Fsck. minix Fsconf
Fdformat Hdparm Mformat Mkbootdisk
Mkdosfs Mke2fs Mkfs. ext2 Mkfs. msdos
Mkinitrd Mkisofs Mkswap Mpartition
Swapon Symlinks Sync Mbadblocks
Mkfs. minix Fsck. ext2 Fdisk Losetup
Mkfs Sfdisk Swapoff  
6. Network Communication
Apachectl Arpwatch Dip Getty
Mingetty Uux Telnet Uulog
Uustat Ppp-off Netconfig Nc
Httpd Ifconfig Minicom Mesg
Dnsconf Wall Netstat Ping
Pppstats Samba Setserial Talk
Traceroute Tty Newaliases Uuname
Netconf Write Statserial Efax
Pppsetup Tcpdump Ytalk Cu
Smbd Testparm Smbclient Shapecfg
7. System Management
Adduser Chfn Useradd Date
Exit Finger Fwhios Sleep
Suspend Groupdel Groupmod Halt
Kill Last Lastb Login
Logname Logout Ps Nice
Procinfo Top Pstree Reboot
Rlogin Rsh Sliplogin Screen
Shutdown Rwho Sudo Gitps
Swatch Tload Logrotate Uname
Chsh Userconf Userdel Usermod
Vlock Who Whoami Whois
Newgrp Renice Su Skill
W Id Free  
8. system settings
Reset Clear Alias Dircolors
Aumix Bind Chroot Clock
Crontab Declare Depmod Dmesg
Enable Eval Export Pwunconv
Kgconv Rpm Insmod Kbdconfig
Lilo Liloconfig Lsmod Minfo
Set Modprobe Ntsysv Mouseconfig
Passwd Pwconv Rdate Resize
Rmmod Grpunconv Modinfo Time
Setup Sndconfig Setenv Setconsole
Timeconfig Ulimit Unset Chkconfig
Apmd Hwclock Mkkickstart Fbset
Unalias SVGATextMode    
9. Backup Compression
Ar Bunzip2 Bzip2 Bzip2recover
Gunzip Unarj Compress Cpio
Dump Uuencode Gzexe Gzip
Lha Restore Tar Uudecode
Unzip Zip Zipinfo  
10. device management
Setleds Loadkeys Rdev Dumpkeys
MAKEDEV      

Vi editor commands in linux

Some advanced editors will contain macro functions, which are certainly not missing in vim. It is very convenient to use Macros in vim:
: Qx starts to record macros and saves the results to register x
Q exit record mode
@ X macro commands for playing records in the x register
After you enter qx in normal mode, all the edits to the text will be recorded. If you enter q again, the record mode will be exited.
And then input @ x to repeat the recorded command. This command can be followed by a number to indicate the number of times to repeat. For example, @ x20 can be repeat 20 times. This is very useful in text batch processing.
Edit multiple files at the same time
Among the many vim plug-ins, there is a plug-in called minibuffer, which is called the tab function below. You can edit multiple files at the same time.
Tag command
: Tabe fn: edit the file fn in a new tab
Gt switch to the next tab
GT switch to the previous Tab
: Tabr switch to the first tab
: Tabl switch to the last tab
: Tabm [N] Move the current tab to the nth tab
Yes, as you think, it is similar to eclipse, ue, and other tabs!
Window command
Ctrl + w s Horizontal Split Window
Ctrl + w switch window
Ctrl + w q exit the current window (because there are multiple files at the same time, this command will not affect other Windows)
Ctrl + w v Vertical Split Window
Others
Vim does not make actual changes to the file before saving, but only loads the file into the buffer. The editing of the file is actually the editing of the buffer. It will not be saved to the physical file until: w.
: E file: load the file to the new buffer.
: Bn jump to the next Buffer
: Bd Delete buffer (close file)
: Sp fn split the window and load fn to the new window
Exit Editor
: W write the buffer to a file, that is, save the modification.
: Wq: Save the modification and exit.
: X Save the modification and exit
: Q exits. If the buffer is modified, a message is displayed.
: Q! Force exit, discard Modification
Search and replace
/Pattern: returns the string pattern.
? Pattern: returns the string pattern.
N: Next match (If yes/search, it is the next one ,? Search to the next one)
N match (same as above)
: % S/old/new/g search the entire file and replace all old with new
: % S/old/new/gc search for the entire file, replace all old with new, and each time you want to confirm whether to replace
Copy and paste
Dd deletes the row where the cursor is located.
Dw deletes a word)
X Delete the current character
X Delete the previous character
D. Delete it to the end of the row.
Yy: copy a row. The command can be followed by a number to identify multiple rows. For example, 6yy indicates that six rows are copied from the current row.
Copy one word from yw
Y $ copy to the end of the row
P paste the clipboard content to the current row
P paste the clipboard content to the current row
] P is indented and vim automatically adjusts the code indent.
"A puts the content into/into register a, and supports multiple clipboard
Note: for example, a commonly used register is a system register with the name +. Therefore, the "+ p" command is pasted from the system clipboard to vim. Note that the "+" operator is not represented here, 21 registers.
Move cursor
In vim, the moving cursor is very different from other editors, but once learned, it will quickly move in the text.
H, j, k, l upper, lower, left, right
Ctrl-f ...... the remaining full text>

Vi editor commands in linux

Some advanced editors will contain macro functions, which are certainly not missing in vim. It is very convenient to use Macros in vim:
: Qx starts to record macros and saves the results to register x
Q exit record mode
@ X macro commands for playing records in the x register
After you enter qx in normal mode, all the edits to the text will be recorded. If you enter q again, the record mode will be exited.
And then input @ x to repeat the recorded command. This command can be followed by a number to indicate the number of times to repeat. For example, @ x20 can be repeat 20 times. This is very useful in text batch processing.
Edit multiple files at the same time
Among the many vim plug-ins, there is a plug-in called minibuffer, which is called the tab function below. You can edit multiple files at the same time.
Tag command
: Tabe fn: edit the file fn in a new tab
Gt switch to the next tab
GT switch to the previous Tab
: Tabr switch to the first tab
: Tabl switch to the last tab
: Tabm [N] Move the current tab to the nth tab
Yes, as you think, it is similar to eclipse, ue, and other tabs!
Window command
Ctrl + w s Horizontal Split Window
Ctrl + w switch window
Ctrl + w q exit the current window (because there are multiple files at the same time, this command will not affect other Windows)
Ctrl + w v Vertical Split Window
Others
Vim does not make actual changes to the file before saving, but only loads the file into the buffer. The editing of the file is actually the editing of the buffer. It will not be saved to the physical file until: w.
: E file: load the file to the new buffer.
: Bn jump to the next Buffer
: Bd Delete buffer (close file)
: Sp fn split the window and load fn to the new window
Exit Editor
: W write the buffer to a file, that is, save the modification.
: Wq: Save the modification and exit.
: X Save the modification and exit
: Q exits. If the buffer is modified, a message is displayed.
: Q! Force exit, discard Modification
Search and replace
/Pattern: returns the string pattern.
? Pattern: returns the string pattern.
N: Next match (If yes/search, it is the next one ,? Search to the next one)
N match (same as above)
: % S/old/new/g search the entire file and replace all old with new
: % S/old/new/gc search for the entire file, replace all old with new, and each time you want to confirm whether to replace
Copy and paste
Dd deletes the row where the cursor is located.
Dw deletes a word)
X Delete the current character
X Delete the previous character
D. Delete it to the end of the row.
Yy: copy a row. The command can be followed by a number to identify multiple rows. For example, 6yy indicates that six rows are copied from the current row.
Copy one word from yw
Y $ copy to the end of the row
P paste the clipboard content to the current row
P paste the clipboard content to the current row
] P is indented and vim automatically adjusts the code indent.
"A puts the content into/into register a, and supports multiple clipboard
Note: for example, a commonly used register is a system register with the name +. Therefore, the "+ p" command is pasted from the system clipboard to vim. Note that the "+" operator is not represented here, 21 registers.
Move cursor
In vim, the moving cursor is very different from other editors, but once learned, it will quickly move in the text.
H, j, k, l upper, lower, left, right
Ctrl-f ...... the remaining full text>

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.