System directory Structure
To make it easier to view the system directory structure, use the tree command:
Installation commands
Yum install-y Tree
Help
Tree--help
Man help command to use
Mans Tree
Tree Usage Example: viewing the root directory under level two
Tree-l 2/
Root folder detailed
Note: The/sbin/directory can only be used by the root account, and the normal account will use/bin/
System startup directory: /boot/
Device Files directory: /dev/
Configuration file directory: /etc/
Normal User home directory:/home/
Root User home directory:/root/
System Library Files directory:/lib/,/lib64/
View a command using those libraries for example: "/bin/ls"
Ldd/bin/ls
Each process PID has a separate file in this directory
File directory generated by the process:/run/
File directory generated by the service:/srv/
System kernel related files directory:/sys/
System temp directory:/tmp/
Note: Anyone can operate but only their own data
ls command
Ls=list
-L Detailed information = = LL
File type, permissions, location, several files exist the same inode, owner, owning group, size, creation time, file name
-I. Inode number
-a show contains hidden directories
-T time, flashback by time
-D only look at the directory itself, not the files listed under Folders
-H automatically displays the most appropriate size units
File type
- Normal file (can be cat open)
Catalog D
C String Device (mouse, keyboard)
L Soft Link
B-Block devices (discs, disks)
s in-machine communication
Alias command
command: which ll
Function: Query specific command alias details
command: alias
Function: Display all system aliases
command: alias pan= ' Ls-lha '
Role: Custom pan aliases are used instead of Ls-lha
To cancel an alias: Unalias
Note: The custom alias path must be $PATH exist in;
Relative path and absolute path
Absolute Path : The absolute path is the real path on the hard disk of the file or directory on your home page, (URL and physical path) such as:
C:xyz Est.txt represents the absolute path to the Test.txt file. The http://www.sun.com/index.htm also represents a URL absolute path.
relative Path : The path relative to a base directory. Contains the relative path to the web (relative to the directory in HTML)
For example:
In a servlet, "/" represents a directory of Web apps. and the relative representation of the physical path. For example: "./" represents the current directory, ". /"represents the parent directory. This similar representation also belongs to the relative path.
command: pwd
Function: Displays the directory where the current user is located
cd command (change Directory)
- go to your last directory
Go to the current user home directory
~ Go to User's home directory
.. Parent Directory
MKDIR and RMDIR
Command: mkdir
Options:
-P If the top-level directory to be set up is not currently established, the upper-level directory will be created
-V Visualization
Command: RmDir
Options:
-P deletes the specified directory if the upper-level directory of the directory has become an empty directory.
Note: Cascading deletions can only be deleted by the empty directory
RM command
R recursive processing, processing all files under the specified directory with subdirectories
F force removal of files or directories
I ask for deletion every time you delete
History: View Historical commands
This article is from "a small dream of egg yolk" blog, please be sure to keep this source http://yolks.blog.51cto.com/10857562/1932542
Linux File Directory Management