It took me two days to sort it out, and some of the most common commands that people on earth know would be skipped! Finally, download the pdf manual. command to change the archive owner: chown [-cfhvR] [-- help] [-- version] user [: group] file... function: Change the file or folder owner parameter format: user of the new file owner IDgroup: user group of the new file owner-c: if the archive owner has changed, the change action is displayed.-f: If the archive owner cannot be changed, do not display an error message.-h: only link is changed, rather than the file that the link actually points to-v: displays the details of the owner's change-R: change the owner of all files and sub-directories in the current directory one by one (that is, change one by one) for example: chown-R oracle: oinstall/oracle/u01/app/oracle Change the directory owner to oracle 2. command: chmod (c Hange mode) function: changes the read/write and execution permissions of files. The signed method and the octal digit method. Option: (1) Syntax: Command Format: chmod {u | g | o | a} {+ |-|=}{ r | w | x} filename u (user) indicates the user himself. G (group) indicates the same group of users. O (oher) indicates other users. A (all) indicates all users. + Permission granted to a specified user. -Cancels the permission granted to a specified user. = Grant the permitted permissions to the file. R (read) indicates that the content of the file or directory can be copied. W (write) write Permission indicates that the content of the file or directory can be modified. X (execute) indicates that you can execute the file or enter the directory. (2) octal digit method: Command Format: chmod abc file where a, B, and c each have an octal digit, indicating the permissions of User, Group, and Other respectively. 4 (100) indicates readable. 2 (010) indicates writable. 1 (001) indicates executable. If the rwx attribute is required, 4 + 2 + 1 = 7; if the rw-attribute is required, 4 + 2 = 6; if the r-x attribute is required, 4 + 1 = 5. For example, # chmod a + rx filename allows all users to read and execute the file filename. # Chmod go-rx filename: cancel the read and execute file filename permissions of the same group and other users. # Chmod 741 filename allows you to read and write files, read files from the same group of users, and execute files from other users. # Chmod-R 755/home/oracle recursively change the directory permission. You can perform read/write operations, read/write operations on the same group of users, and read/write operations on other users. 3. run the "touch format: touch filenae" command to modify the file date. do not modify the file content. If the file does not exist, create a new file. Example: % touch file 4. link file command: ln (link) Format: ln [option] filename linkname ln [option] directory pathname function: Creates a chain for a file or directory. Filename and directory are the source file name and source directory name. linkname and pathname indicate the files or directories linked to the source file or source directory name respectively. Option:-s creates a symbolic link for a file or directory. If-s is not added, a hard link is created for a file or directory. Note: The link aims to assign more than two names to a file or directory so that it can appear in different directories, you can share files or directories and save disk space. Example: % ln-s filename linkname 5. display date command: date for example: % date 6. run the "Show calendar" command: cal (calendar) Format: cal [month] year function: displays the specified calendar for a year, for example, % cal 1998 7. command for displaying the file header: head format: head [option] filename function: display the File Header Options: by default, the first 10 lines of the file are displayed. -I: displays the start line of the file. Example: % head filename 8. tail command: tail format: tail [option] filename function: display the end Of the file option: the last 10 lines of the file are displayed by default. -I: displays the last line of the file. + I is displayed from row I of the file. For example, % tail filename 9. Command for displaying user IDs: id format: id [option] [user] function: displays user IDs and all groups to which users belong. Option:-a displays the user name, user id, and all Group notes of the user, for example, % id username 10. view the currently logged-on user command: users 11. display who is logged on to the machine command: who format: who function: display all the usernames in the system currently, using the terminal device number, registration time. Example: % who 12. display the user name command on the current terminal: whoami format: whoami function: displays the users used on the current terminal. Example: % whoami 13. file search command: find format: find pathname [option] expression Function: find a file that matches the expression under the given channel name. Option:-name indicates the file name-user username. Select the file-size to which the user belongs and search by size. The unit is block, A block is 512B-mtime n, which is queried based on the last modification time, select the modified file in n days-perm search by permission-type search by file type-atime search by last access time for example: % find. /-name '* abc *'-print 14. search file match command: grep format: grep [option] pattern filenames function: searches the specified file or standard input line by line, and displays each line of matching mode. Option: Ignore case-v when matching-I to find out the line with Mode Mismatch, for example, % grep-I 'java *'. /test/run. sh 15. word Count command: wc [option] filename function: used to count the number of lines, characters, and characters in a file. Option:-l number of rows in the statistics file-w number of words in the statistics file-c number of characters in the statistics file note: if the default file name is used, the standard input is % wc-c. /test/run. sh 16. disk Space display command: df (disk free) Format: df [option] function: displays the usage of disk space, including the directory name, block device name, Total Bytes, used bytes, and percentage of remaining bytes installed on the file system. Option:-a: displays all file systems and disk usage of each partition-I: displays I-nodes usage-k: The size is represented by k (default) -t: displays the disk usage of all partitions in a file system-x: displays the disk usage of all partitions not in a file system-T: display the name of the file system to which each partition belongs-h: indicates the output using "Human-readable", that is, the file system size uses readable formats such as GB and MB. Note: For example, % df-hi 17. disk Space Command for querying files or directories: du (disk usage) Format: du [option] [filename] function: the unit is the subdirectory in the specified directory, show the disk space occupied by all files in each directory option:-a: displays the disk space occupied by all directories and each file in the second directory-B: the size is represented by bytes (the default value is k bytes)-c: add the total (default value)-s: only display the total size of each file-x: calculate only files of the same file system-L: Calculate all files-h: indicates that the file system size is in a readable format such as GB and MB. For example, % du-a % du-sh/etc only displays the Total % du/etc of the directory. | sort-nr | more: sort the statistical results using the sort command, the-nr parameter of sort indicates that reverse sorting is performed by numerical sorting. 18. display process command: ps format: ps [option] function: displays information about processes in the system. Including process ID, control process terminal, execution time, and command. Option: -a: displays all processes.-U uidlist: lists all processes of the user.-e: displays information about each running process.-f: displays a complete list.-x: displays processes without terminal control. status. Note: For example, % ps-ef % ps-aux is then directed to grep with a pipeline symbol to find a specific process and then operate on the specific process. 19. Terminate the process command: kill format: kill [option] pid function: send a signal to the specified process or terminate the process. The purpose of the kill command is to send a signal to a process, because most of the messages are sent to kill the SIGKILL or SIGHUP of the process, so it is called the kill option:-9 forcibly terminate the process. Note: pid indicates the process number, which can be obtained by the ps command. For example, % kill-9 pid, you can also use kill-l to view the number words that can replace signal number. For more information about kill, see man kill. 20. view your own IP address command: ifconfig format: ifconfig-a 21. view route table command: netstat format: netstat-rn 22. remote logon command: telnet hostname 23. file transfer command: ftp (file transfer program) Format: ftp hostname function: Network file transfer and remote operations. Option: ftp command: cd [dirname] enter the remote machine directory LCD [dirname] set the local machine directory dir/ls to display the remote directory file bin for binary transmission asc for text file transmission get /mget retrieves one or more files from the remote machine put/mput and sends one or more files to the remote machine. When prompt is enabled or multiple files are closed, the interaction prompt is "close ". quit ftp! /Exit ftp login status ,! Indicates that the ftp is temporarily exited and the local directory is returned. The exit indicates that the ftp status is returned. Note: % ftp hostname 24. view your own email command: mailx format: mailx option: delete next quit exit reply 25. recall command: history format: history function: helps users recall executed commands. Option: Comment: for example: % history 26. online conversation command: talk format: talk username function: chat with another user online. Option: Note: During a dialog, the system divides the terminal into the upper and lower parts. The upper half displays the information you typed, and the lower half displays the information you typed. Type delete or Ctrl + C to end the dialog. Example: % talk username 27. command to allow or reject message sending: mesg (message) Format: mesg [n/y] function: Allows or rejects other users to send information to their own terminal. Option: n deny other users to write information to their terminals y allow other users to write information to their terminals (default value) Note: % mesg n 28. command: write format: write username [ttyname] function: write information to terminals of other users. Option: Note: if the recipient does not refuse, the dual-user can talk. Type EOF or Ctrl + C to end the conversation. Example: write username 29. create, modify, and delete users and groups. create a group: for example, groupadd oinstall creates a group named oinstall groupadd-g 344 dba creates a group with a group number of 344. In this case, a group ID (GID) is generated in the/etc/passwd file) is a project of 344. B. modify group: groupmod: this command is used to change the attributes of the user group account groupmod-g New GID user group account name groupmod-n new group name original group name: This command changes the user group name c. delete group: groupdel group name: this command is used to delete the specified group account d. create a user: command: useradd [-d home] [-s shell] [-c comment] [-m [-k template] [-f inactive] [-e expire] [-p passwd] [-r] Main Parameter-c: add the remarks text and save the remarks text in the remarks column of passwd. -D: Specify the start directory when the user logs on. -D: Change the default value. -E: Specifies the validity period of the Account, which is permanently valid by default. -F: specifies the number of days after the password expires. -G: Specifies the group to which the user belongs. -G: Specify the additional group to which the user belongs. -M: automatically creates a user's logon directory. -M: do not automatically create a user's logon directory. -N: cancel the creation of a group named by the user name. -R: Create a system account. -S: Specifies the shell used after the user logs on. -U: Specifies the user ID. Example: # useradd-g oinstall-G dba oracle create Oracle user e. command to delete a user: userdel user name to delete the specified user account userdel-r user name (userdel user name; rm User Name): Delete the specified user account and the Home Directory example: # useradd-g root kkk // Add the kkk user to the root group f. modify user command: usermod modify existing user information usermod-l old username new username: Modify usermod-L Username: used to lock a specified user account, make it unable to log on to the system usermod-U Username: unlock the Locked User Account passwd-d Username: Leave the account without a password, that is, the user can log on to the system without a password. Example: # usermod-l user2 user1 // rename user2 to user1 30. enable or disable a firewall Close chkconfig iptables on chkconfig iptables off takes effect immediately: After restart, restore service iptables start service iptables stop or:/etc/init. d/iptables start/etc/init. d/iptables stop 31. start VSFTP immediately:/etc/init. d/vsftpd start:/etc/init. d/vsftpd stop default VSFTP Service Automatic Start: Method 1: (Common \ convenient) [root @ localhost etc] # chkconfig -- list | grep vsftpd (check the situation) vsftpd 0: off 1: off 2: off 3: off 4: off 5: off 6: off [root @ localhost etc] # chkcon Fig vsftpd on (execute ON settings) or: Method 2: Modify the file/etc/rc. local: insert/usr/local/sbin/vsftpd & into the file to enable automatic start upon startup. 32. vi tip a. Enter the input mode to add (append) a: add data from the end of the cursor position, and move the data after the cursor along with the new data. A: add data at the bottom of the column where the cursor is located. Insert I: insert data from the front of the cursor. The data after the cursor is moved to the backend with the new data. I: insert data starting from the first non-blank character in the column where the cursor is located. Open o: adds a column under the column where the cursor is located and enters the input mode. O: Add a new column to the column where the cursor is located and enter the input mode. B. Exit vi. In command mode, type: q,: q !,: Wq or: x (Note: No.), the vi will be exited. Where: wq and: x are stored and exited, while q is directly exited. If the file has a new change, vi will prompt you to save the file and the q command will also be invalid, in this case, you can use the w command to save the file and then use q to exit, or use the wq or x command to exit. If you do not want to save the changed file, you need to use: q! Command to exit vi without saving the file. C. Command for deleting and modifying files: x: Delete the character where the cursor is located. Dd: Delete the column where the cursor is located. R: Modify the character where the cursor is located and the character to be corrected after r. R: Enter the retrieval and replacement status. The new text will overwrite the original text until you press [ESC] to return to the command mode. S: Delete the cursor character and enter the input mode. S: Delete the column where the cursor is located and enter the input mode. D. screen tumble command Ctrl + u: Ctrl + d: Ctrl + f: Ctrl + B: flip a screen at the beginning of the file nz: roll line n to the top of the screen. If n is not specified, roll the current line to the top of the screen. E. DELETE command ndw or ndW: Delete the n-1 words "do" at the beginning of the cursor and the n-1 words "do" at the end of the line: Delete to the beginning of the line d $: Delete to the end of the line ndd: delete the current row and its N-1 rows x or X: delete a character, x Delete the cursor, and X Delete the Ctrl + u before the cursor: delete text entered in input mode f. search and replace command/pattern: search pattern from the beginning of the cursor to the end of the file? Pattern: Search for pattern n from the beginning of the cursor: Repeat the previous SEARCH Command N in the same direction: Repeat the previous search command in the opposite direction: s/p1/p2/g: replace all p1 in the current row with p2: n1, n2s/p1/p2/g: replace all p1 in line n1 to n2 with p2: g/p1/s // p2/g: replace all p1 files with g. copy and paste (1) selected text blocks, use v to enter the visible mode, move the selected content of the cursor key (2) copy the selected block to the buffer, use y; copy the entire row, use yy (3) to cut the selected block to the buffer, use d; cut the entire row and use dd (4) to paste the content in the buffer, and use p h. open the second file in the same editing window, use: sp [filename] to switch between multiple editing files, and use Ctrl + w
Linux_unixcommonly used command to quickly find the album .rar http://up.2cto.com/2012/0326/20120326023519180.rar
Author cuishen