Article From:https://www.cnblogs.com/w494129131/p/9124669.html

1、System directory structure

ls(list):Get the system’s directory or file information

  ls /root/:rootThe user’s home directory to save the user’s configuration file

yum install -y treeCarry out installation

tree –hepTo show the common options:

man To display the help file of a file, execute man tree:

tree -L 2 /To display the two level subdirectories and files in the root directory:

  bin、sbin、/usr/bin、/usr/sbin:A soft connection that stores common commands.

  sbinThe command stored under is used by root users, and commands under bin are used by ordinary users and root users.

  /boot/:System startup related files:

  /dev:linuxSpecific device files in the system:

  /etc/:Store the system configuration file:

  /home/:Home directory of ordinary users to store user’s home directory files

  /lib、/lib64:Store the library files of the system. You can view the library file of LS by executing LDD /bin/ls:

7.0The version starts CentOS no longer distinguishes 32 bits and 64 bits. All are 64 bits.

  /meida/:The media directory is empty by default. If you insert the USB, it will automatically display the directory.

  /mnt/:The default is also an empty directory. You can temporarily mount CD-ROM, hard disk and so on in this directory.

  /proc/:System startup process, create directory for each process, you can view the PID of the process through this directory, and then check the details of the process.

  /run/:Temporary files generated by the stored procedure will disappear after shutdown.

  /srv/:serviceThe abbreviation, by default, is stored in the file generated by the service.

  /sys/:Files stored in the system kernel will not change at ordinary times.

  /tmp/:System temporary directory, by default, all users can modify the files under this directory.

  /usr/:Store the user’s files:

  /var/log:Storing log files

2、lscommand

  ls -l:Display the details of the file

the firstrootRefers to the file owner; the second root is the subordinate group; the 1422 refers to the file size, the unit is B; then the time and file name.

  ls -i anaconda.cfgLook at the iNode of the file (the owner of the file, the group, and other information), and the same two files of the iNode refer to the same file, but the name path is different.

  ls -la:View all files in the directory, including hidden files and directories.

  ls -lta:In chronological order, the sooner the time goes down

  ls -d:Only displays the information of the directory itself. Without -d, subdirectories and file information will be displayed.

the other uses can be passed throughman lsSee:

  llThe command is the same as the LS -l effect. Ll is the alias of LS -l:

3、file type

ls -lView the file:

the leftmost column represents the file type,”“d”It means that this file is a directory, “-” means that this file is a common text document, and that the text can be viewed through the cat command, but if the file has the following color, it is a compiled binary file that can’t be viewed:

if the type of file displayed is“c”,It represents string devices:

  “l”Representing soft connections:

  “b”Representing block devices, such as CDs, disks, etc.

  “s”A file representing socket files that communicate between two processes of the same device:

4、alias

  aliasIt is a combination of commands and options into a new command. If you don’t use aliases, you can use the absolute path, such as “LS”, you can use /usr/bin/ls.

whichView the alias of the command (part of the command is not alias):

through executionaliasCommand to see which commands have alias:

  whichIs to look at the path of a file

  PATHIt is the environment variable that can be seen as a series of directories by executing echo $PATH, and if the command is in the following directory, it can be executed, and if not in the following directory, it can not be executed, and which is to find the commands in the following directory:

alias aming=“ls -lha”To make the aming command equivalent to LS -lha, you can view it through which:

unalias amingTo cancel the alias:

 

Similar Posts:

Link of this Article: 6.1

Leave a Reply

Your email address will not be published. Required fields are marked *