Summary of some common SSH commands in Linux

Source: Internet
Author: User
Tags gz file

Directory operation:
Rm-RF mydir/* Delete the mydir directory */
CD mydir/* enter the mydir directory */
CD-/* Go back to the upper-level directory */
CD ../* back to the parent directory with spaces in the middle */
Cd ~ /* Return to the root directory */
MV tools tool/* rename the tools directory to tool */
Ln-s tool BAC/* Create a symbolic link named BAC for the tool directory. The most familiar thing is that WWW in FTP is linked to the public_html directory */
CP-a tool/home/vpser/www/* Copy all files in the tool directory to the WWW directory */

File Operations:
Rm go.tar/* Delete the go.tar file */
Find Mt. cgi/* find the file named Mt. cgi */
DF-H/* Check the remaining disk space. It seems unnecessary unless you are too busy */

Decompress:
Tar xvf wordpress.tar/* Extract files in tar format */
Tar-tvf myfile.tar/* view files contained in the TAR file */

Tar CF toole.tar tool/* pack the toolcontents as a toole.tar file */
Tar cfz vpser.tar.gz tool/* The variable file is about 10 MB */

Tar jcvf/var/bak/www.tar.bz2/var/www // * Create .tar.bz2 file, high compression rate */
Tar xjf www.tar.bz2/* decompress the tar.bz2 format */

Gzip-D ge.tar.gz/* decompress .tar.gzfile as a .tar file */
Unzip phpbb.zip/* decompress the ZIP file. It is a bit troublesome to compress a .tar.gz file in Windows */

Download:
Wget http://www.openboy.net/web/nginx/nginx-0.8.0.tar.gz
/* Download files from the remote server to your server, saving the upload cost. If the server is not m, the bandwidth is M. It is not tens of seconds to download a 2-3 MB Mt */
Http://www.openboy.net/web/nginx/nginx-0.8.0.tar.gz wget-C
/* Continue to download the last undownloaded file */

Reprinted please indicate the source: pig SpaceHttp://www.openboy.net

Process Management:
PS-Aux/* PS Process status query command */

Description of the ps command output field:
[LIST]
[*] User: the user name of the process owner.
[*] PID, process ID, which uniquely identifies a process.
[*] % CPU, percentage of CPU time and total time occupied by the process since the last refresh.
[*] % MEM, percentage of memory used by the process.
[*] Vsz, virtual memory used by the process, in K.
[*] RSS, total number of physical memory occupied by processes, in K.
[*] Tty, the terminal name related to the process.
[*] Stat, Process status, used (R-run or prepare to run; s-sleep status; I-idle; Z-frozen; D-uninterrupted sleep; w-the process does not reside on the page; t stops or tracks .) These letters.
[*] Start, the process start time.
[*] Time, total CPU time used by the process.
[*] Command, the command line to be executed.
[/LIST]

PS-Aux | grep nginx/* search for nginx processes in all processes */
Kill 1234/* 1234 is the process ID, that is, the PID in PS-aux */
Killall nginx/* killallProgramDirectly kill all processes. nginx is the process name */

Vim operation:

Mobile class:
H/J/k/L: move one cell to the left/bottom/up/right
W: Move backward words (How many words are added before the number)
B: Move the forward word (How many words are added before the number)
E: Move backward to the end of the word
Ge: move forward to the end of the word
$ <End>: End of a row
0 <Home>: Beginning of the line
TX: Search for X in the row to the right and move it there (to the left in uppercase)
33g: Move to the 33rd rows of the file
GG: first line of the file
G: The end of the file.
33%: 33% of the file
H/m/L: the beginning, middle, and end of the screen.
ZT/ZZ/ZB: Move the current row to the beginning/center/Bottom of the screen

Jump:
": Return to the jump location.
CTRL-O: Jump to an older place
CTRL-I <tab>: jump to a newer place

Search:
/: Search down (add a keyword)
? : Search up (followed by a keyword)
N: The next matched record

Edit:
I: Switch to insert mode
X: Delete the current character
.: Repeat the last modification operation (same as Ctrl + F in PS to execute the filter)
U: Undo operation
CTRL-R: redo
P: insert the deleted characters to the current position (Put)

Exit and save:
: Q: Exit
: Q! : Do not save and exit
ZZ: Save and exit
: E! : Abandon modification and re-edit

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.