SUSE Linux Common commands
(1) Command ls--list files
Ls-la gives a long list of all the files in the current directory, including a "hidden" file that starts with a period LS A * lists all the files in the current directory that begin with the letter a ls-l *.doc gives all files in the current directory that end with. doc
(2) command cp--copy files
CP afile Afile.bak Copy the file as a new file Afile.bak
CP afile/home/bible/Copy the file Afile from the current directory to the/home/bible/directory CP */tmp Copy all the hidden files in the current directory to the/tmp/directory
CP-A Docs Docs.bak recursively copies the docs directory under the current directory to the new directory Docs.bak, preserves the file attributes, and copies all the files, including hidden files that begin with a period. For convenience, the-a option contains the-r option
Cp-i asks the user cp-v to tell the user what they are doing before overwriting
(3) command mv--move and rename files mv Aflie bfile Rename Afile to bfile
MV Afile/tmp Move the afile under the current directory to the/tmp/directory
(4) Command rm--delete files and directories rm afile Delete Files Afile
RM * Deletes all files in the current directory (no hidden files). The RM command does not delete the directory unless the-R (recursive) parameter is also specified.
RM-RF domed Delete the domed directory and all the content it contains
Rm-i * Deletes all files starting with the letter A in the current directory, and prompts the user to confirm each deletion
(5) command cd--change directory CD ~ Switch to home directory
CD/TMP switch to Directory/tmp
cd dir switch to dir directory CD/switch to root directory in current directory
Cd.. Switch to the top-level directory CD: /.. Switch to the top level two directory
CD ~ Switch to the user directory, such as the root user, then switch to/root (6) command mkdir--Create directory
mkdir phots to create a directory named photos in the current directory
Mkdir-p This/that/theother Create a specified nested subdirectory (7) in the current directory mkdir--Delete directory mkdir will delete empty directory
(8) command more, less--view the contents of the file
MORE/ETC/PASSWD View/etc/passwd content features: Pagination display commands
More file
The more command can also be passed through the pipe character (|) Use with other commands, for example: PS Ux|more
Ls|more
LESS/ETC/PASSWD viewing the contents of/etc/passwd
(9) Command grep--search for file contents
grep Bible/etc/exports finds all rows that contain Bible in file exports
Tail-100/var/log/apache/access.log|grep 404 finds rows that contain "404" in the 100 rows of the Web server log file Access.log
Tail-100/var/log/apache/access.log|grep-v Googlebot in the 100 rows of the Web server log file Access.log to find rows that are not accessed by Google
Grep-v ^#/etc/apache2/httpd.conf in the main Apache configuration file, find all non-comment lines (10) command find--Find files
Find.-name *.rpm looking for RPM packages in the current directory
Find. | grep page looks up the file name in the current directory and its subdirectories that contains the page files locate traceroute anywhere on the system find file names that contain traceroute files
(11) Command vi--Edit file
Vi/etc/bubby.txt with vi Edit file/etc/bubby.txt vim/etc/bubby.txt Edit file with vi/etc/bubby.txt quick action:
Toggle window: alt+1,alt+2 fullscreen: ALT + ENTER
Hold vim Up (pause): Ctrl + Z, pause after other shell operation, after the end can be switched back to the Vim interface via FG command to continue editing
: MR: View History file Record (note: Mr Capitalization)
: SP Landscape Switch Interface window: VSP Vertical Switch Interface window facilitates multi-file control coding (e.g.) emacs/etc/bubby.txt edit files with Emacs/etc/bubby.txt
(12) Order RZ, sz--file upload download
Run the command sudo rz, that is, to receive the file, Xshell will pop up the file selection dialog box, select the file and close the dialog box, the file will be uploaded to the current directory in Linux.
Run command sudo sz file is to send files to Windows (the saved directory can be configured) more convenient than the FTP command, and the server no longer open FTP service. (13) Command cat--display file contents
Cat file
(14) Command ps--view process PS [options]
DESCRIPTION (description): PS command displays some information about the run program options. If you want to display some duplicate information for an option, use the top command instead. Use standard syntax to view each process on the system. Ps-e Ps-ef Ps-ef ps-ely
(15) Order kill--Kill the process
[Email protected] ~]# kill-signal%jobnumber [[email protected] ~]# kill-l
Xshell Command Daquan