Last update at :2024-05-12,Edit by888u
01.【cd】 The cd command not only displays the current status, but can also change the current status. The cd in Linux is similar to that in DOS. #cd /home/wwwroot (enter the /home/wwwroot directory) #cd .. (enter the upper directory) #cd – (enter the last directory entered) #cd / (enter the root directory) Introduction to common commands for linux VPS newbies
02. 【tar】 The tar command is commonly used in the packaging backup and decompression process in our VPS. #tar cvf a.tar.gz *.* (package all files in the current directory and compress them into file names a.tar.gz) #tar cvf a.tar.gz /home (package all files in the home folder and compress them into file names a.tar.gz) #tar xvf a.tar.gz (Extract a.tar.gz to the current folder, zxvf can also be used) #tar tvf a.tar.gz (Browse the files in the a.tar.gz compressed package)
03. 【rm】 rm is the delete command in linux. #rm a.tar.gz (delete a.tar.gz, then confirmation will appear, enter y) #rm –r (Delete directories and confirm one by one) #rm –rf (forced deletion, no confirmation)
04.【ls】 ls is equivalent to dir in the DOS command, listing files in the current directory. (Note: dir can also be used in Linux) #ls (list directory files) #ls –l (list files and show details) #ls -l |more (Too many directories are displayed in split screen) Introduction to common commands for linux VPS newbies
05.【mv】 mv is move, but it also has a renaming function. #mv a.tar.gz /home (move a.tar.gz in the current directory to the home directory) #mv a.tar.gz b.tar.gz (rename a.tar.gz to b.tar.gz)
06.【cp】 The full name of cp is copy, which naturally means copying. #cp a.tar.g /home (copy a.tar.gz in the directory to the home directory, you can select multiple times at once, just add the file name after cp) #cp –R (Copy the entire directory, including subdirectories)
07. [Directory permissions]
To solve the problem that the installation program prompts that there is no corresponding file read and write permissions, you need to execute the following commands at the same time. #chmod 777 -R virtual host directory /*permissions*/ #chown www(group):www(username) -R virtual host directory /*owner*/
08. 【wget】 wget http://soft.vpser.net/web/nginx/nginx-0.8.0.tar.gz /*Download the files on the remote server to your own server, even uploading is saved. The server has either 100M or 1000M bandwidth. Downloading a 2-3 MB MT does not take dozens of seconds */ wget -c http://soft.vpser.net/web/nginx/nginx-0.8.0.tar.gz /* Continue to download files that were not downloaded last time */
09. 【ps】 #ps -aux /*ps process status query command*/ #ps -aux | grep nginx /*In all processes, find the process of nginx*/ kill 1234 /*1234 is the process ID, which is the PID in ps -aux*/ killall nginx /*killall directly kills all processes through the name of the program, nginx is the process name*/ The meaning of the ps command output fields: [*]USER, the user name of the process owner. [*]PID, process number, can uniquely identify the process. [*]%CPU, the CPU time occupied by the process since the last refresh and the percentage of the total time. [*]%MEM, the percentage of memory used by the process. [*]VSZ, the virtual memory size used by the process, in K. [*]RSS, the total amount of physical memory occupied by the process, in K. [*]TTY, process-related terminal name. [*]STAT, process status, used (R-running or ready to run; S-sleep state; I-idle; Z-frozen; D-uninterrupted sleep; W-process has no resident pages; T stops or traces.) represented by these letters. [*]START, the time when the process starts running. [*]TIME, the total CPU time used by the process. [*]COMMAND, the command line to be executed. 【Other commands】 #mkdir (create directory) #su (switch user) #pwd (displays the user's current directory) #ftp (connect to FTP) #passwd (change password) #reboot (restart) #restart (*also means restart, for example: /root/lnmp restart)
Recommended site search: cloud server rental, local IP query, international domain name, US anti-attack server, overseas virtual host, domain name free registration 0 yuan registration, free proxy ip, check ip, US website server, virtual host 0 yuan Purchase,
发表评论