Ls
Function: View the files in the directory
Format: direct ls view current directory, or ls parameter / directory name
Parameters:- l View details
-A show hidden files
. represents the current directory
.. Parent Directory
-G uses different colors to mark different types of files (commonly used under Mac OS, ubuntu default ls = ls-g)
Pwd
Role: View Path
Format: Direct pwd View current path, or pwd directory name
Cd
Tips:
Direct CD or CD ~ back to /Home
CD- back to the last switch directory
CD/ back to the root directory
Date
View system time
Hwclock
View BIOS time
Shutdown command:
Shutdown
Format:shutdown parameter
-R Restart (-R+ min) (-Rnow)
-H Shutdown (-h+ min) (-H now)
-C cancel shutdown command
Init
Role: Switching system level
Format: init 0-6
Init 0 is used to immediately switch the system runlevel to 0, i.e. shutdown
Init 6 is used to immediately switch the system RunLevel to 6, that is, restart
Reboot
Restart
RunLevel
View current system Run level
Switch to the graphical interface in the character interface:
1, StartX
Start the graphical interface only, without switching the system RunLevel
2. Init 5
Switching system operating levels
! $ last parameter of previous command
echo Prints the value of a variable or a string
Create an empty file
Touch file name . extension (can be extended without extension)
Terminal Clear Screen
Ctrl + L
Create an empty folder
mkdir file name (makedirectory)
Mkdir-p/ROOT/1/2/3/4/5 plus parameter - p to create a path directly
Copying files
Cp
-r Copy entire folder (the source folder is created under the target directory)
eg cp-r/etc//root/copy the entire etc to root
-R. /* Copy all files under the entire folder (no source folders are created)
eg cp-r/etc/*/root/ Copy all the files under etc to root
Delete
RM-RF file or directory name
-R Recursive Delete (delete all files in directory and directory)
-F forcibly removed
If you do not add the-r parameter, you are prompted not to delete the directory
Without the- F parameter, you will be asked if you want to delete
Rename / move
MV Source Target
View hard disk usage
Df-h
Viewing the current Mount situation
Mount
Several common Linux commands