Linux command

xiaoxiao2021-03-18  192

LINUX common command profile

The su su command is one of the most basic commands, which is often used in different user switches. For example, if you log in to USER1, you want to switch to user2, just use the following command: $ su user2 then the system prompts to enter the USER2 password, you can switch to USER2 after entering the correct password. You can use the exit command to returns to user1 after completion. The common usage of the su command is to become a root user or super user. If the su command without a username is issued, the system prompts to enter the root password, and can be switched to root users after input. If you log in to the root user, you can use the su command to be any user on the system without a password.

The PWD PWD command is also one of the most commonly used commands to display the current directory where the user is located.

The CD CD command not only displays the current state, but also changes the current state, which is basically consistent with the CD command under DOS. Cd .. You can enter the previous directory CD - can enter the previously entering directory CD ~ can enter the user's Home directory

The LS LS command is the same as the DIR command under DOS, which is used to display the contents of the current directory. If you want to get detailed information, you can use the ls -l command so that details of the directory content can be displayed. If there is too much file in the directory, you can't display it with a screen, you can display it with the LS -L | MORE screen.

The Find Find command is used to find files. This command can be searched by the file name, establishes or modifies the date, the owner (usually the user who creates files), file length or file type. The basic structure of the Find command is as follows: $ find specifies which directory start search. Specify search criteria. It means how to find a file. In general, use -Print action to display the entire file path and name. If there is no action, the Find command performs the search and does not display the result, equal to white feet. For example, to search for all files on the system, you can use the following command: $ find / -name ye -print This can display files on all names Ye on your system.

TAR TAR was originally used to establish a tape backup system, which is currently used to establish file publishing files. TAR files can be created as follows: $ TAR CVF For example, if you want to archive all files in Ye.TAR in the current directory, you can use the following command: $ TAR CVF Ye.tar *. * To view the file content, turn the C option into t. If you want to browse the content in the Ye.TAR file, you can use the following command: $ TAR TVF Ye.tar To take the contents of the file, turn the C option into X. If you want to take the contents of the Ye.TAR file to the current directory, you can use the following command: $ tar xvf ye.tar

The gzip gzip command is used to compress files. For example, if you want to compress the Ye.txt file, you can use the following command: $ gzip ye.txt can compress file and add the GZ extension after the file name, become file Ye.txt.gz. The decompressed file can be implemented with a gzip -d command: $ gzip -d ye.txt.gz This can decompress files and delete the GZ extension. In addition, you can use the gunzip command to explain the compressed file, the effect is the same as the gzip -d command. The old version of the tar command does not compresses the file, it can be compressed with GZIP. For example: $ TAR CVF Ye.tar * .txt $ gzip ye.tar can establish a compressed file Ye.tar.gz. The new TAR can directly access and establish GZIP compressed TAR files, as long as the z option is added in the tar command. For example: $ TAR CZVF Ye.tar * .txt Generates Compressed Archive Ye.tar.gz, $ TAR TZVF Ye.tar * .txt Displays the contents of the compressed file Ye.Tar.gz, and $ tar xzvf ye.tar * .txt Remove the contents of the compressed archive Ye.Tar.gz. Mkdir This command is simple, with DOS's MD command usage, used to establish a directory.

The CP CP command is used to copy files or directories. The CP command can copy multiple files at once, for example: $ cp * .txt * .doc * .bak / home extension the current directory to TXT, DOC, and BAK all copied to the / home directory. If you want to copy the entire directory and all the subdirectories, you can use the CP -R command.

The RM RM command is used to delete a file or directory. The RM command will force the file that can be used if you want to confirm when you want to confirm it, you can use the RM -I command. If you want to delete a directory, use the RM -R command. The RM -R command is deleted when the directory is deleted, and the prompt will be displayed every file or directory. If the directory is too large, the response is unrealistic. At this point, you can use the RM-RF command to force the directory so that the -i flag is used to handle it.

The mv mv command is used to move files and renamers. For example: $ mv Ye.txt / Home Moves the Ye.txt file in the current directory to the / home directory, $ mv ye.txt ye1.txt Remove the Ye.txt file to Ye1.txt. Similar to the CP command, the mv command can also move multiple files at a time, which is no longer repeated.

Reboot restarts the command, don't say more.

Halt shutdown command, don't say more.

Install software rpm -ivh aaa.rpm tar xvfz aaa.tar.gz; cd aaa ;./configure;make;make install

Do not let ordinary users change password (MyXFC) [root @ xin_fc etc] # chmod 511 / usr / bin / passwd also wants ordinary users to change password [root @ xin_fc etc] # chmod 4511 / usr / bin / passwd

转载请注明原文地址:https://www.9cbs.com/read-129953.html

New Post(0)