tree Basic use of commands

tree View the tree structure of the current directory
-a  View all files that contain hidden files
-L 1  Look at the directory hierarchy
tree /root   Specify the directory 


The main files in the root directory

/bin Binary files that ordinary users can execute

/boot   System startup file

/dev Device file

/etc Configuration file of system program

/home Home directory for ordinary users

/usr The installation directory of the user program

/var System variable file

/tmp It's like a recycle bin , Any user can operate the files in the directory , It's just that you can only operate your own .

/run How to start a program pid The file will be in it



Directory structure

/etc Important profiles

/etc/passwd #  The profile of the user in the system
/etc/group #  Files for user groups
/etc/shadow #  File to store user password
/etc/hosts #  Local domain name resolution file
/etc/resolv.conf #  Special storage dns Configured
/etc/sysconfig/network-scripts/ifcfg-eth0 #  Network card profile
/etc/hostname #  Hostname profile
/etc/skel #  When you create a user, you will modify the contents 

/usr

/usr/local #  Store the program directory installed by the user
/usr/bin
/usr/sbin
/usr/lib #  The library files ,32 position , Used to support the normal operation of commands
/usr/lib64 #  The library files ,64 position , Used to support the normal operation of commands 

/var

/var/log/messages #  system log
/var/log/secure #  System log
/var/spool/cron/root # Timing task 

/proc

The information system stores , Program process number

/proc/cpuinfo # CPU Information
/proc/meminfo #  Memory information 

/dev

/dev/random #  Random number device
/dev/null #  Black hole file
/dev/zero #  Infinite files
/dev/sda #  The first disk of the physical machine
sda1 #  The first partition of the first disk
sda2 #  The second partition of the first disk
sda3 #  The third partition of the first disk
/dev/sdc3 #  The third partition of the third hard disk
/dev/pts #  Virtual terminal
/dev/cdrom #  Compact disc 

Location of file path

Two special directories

 Use ll What do you usually start with when you read a document :
d #  Catalog
- #  Ordinary documents
l #  Link to the file
c #  Device file
Special catalogue
".": Current directory
"..": Upper level directory
"~":   User home directory
If it is root /root
If it is bob /home/bob

Absolute path and relative path

 Absolute path :  With / perhaps ~ The directory at the beginning represents the absolute path .
Relative paths : Not in / perhaps ~ The directory at the beginning represents the relative path .


Switch directory command usage

cd  Options   Parameters
cd    Options    Parameters :  Never use options
cd /usr/local
cd ../local
cd /tmp
cd ~
cd ~/.ssh
cd ..
cd .
cd ./local
cd -  :   Switch to   Last Directory
pwd #  Show the current path