Date of 1st
1 time to view the current system by date date
2 format display time date +%y--%m--%d, the middle of the connection symbol can be arbitrary
3 Set the time of the system sudo date-s "Xx:yy::zz"
4 View Calendar
5 using Uptime to view the system's running time
2 Output View command
1 using echo to show what is entered
2 using Cat to display the contents of a file
3 The contents of the display file with the more command page (only page DOWN)
3 using the less command to page the contents of the display file (able to page up and down), press Q exit view
4 Displays the first few lines of the file with the head command. The default is 10 lines
We can also specify the number of rows to display by-N x
5 Use the tail command to display the end of a file line, the default is 10 lines
We can also specify the number of rows to display by-N x
3 View the hardware information
1 PCI devices for viewing hardware through LSPCI, you can display detailed information with-V followed by
2 USB device to view hardware through LSUSB, you can display detailed information in the rear plus-V
3 through Lsmod to view the driver that the system has loaded
4 Shutdown and reboot
1 Shutdown command
1 immediate shutdown sudo shutdown-h now
2 10 minutes after shutdown sudo shutdown-h +10
3 Specify 23:30 shutdown sudo-shutdown-h 23:30
4 Restart sudo shutdown-r now
2 Use the Poweroff command to shut down the machine immediately
sudo poweroff
3 Use the reboot command to reboot immediately
sudo reboot
5 Archiving and compression
1 compressing files with zip command
Zip xxx.zip destination File
2 using unzip to extract files
Unzip Xxx.zip
3 using the TAR command to archive folders (and compression is different)
1 TAR-CVF Xxx.tar target folder
For example, I want to back up the Goagent folder in my home directory, so I can create an archive file
4 Unlock an archive TAR-XVF Xxx.tar
5 Archive a file first and then compress Tar-cvzf xxx.tar.gz target folder
6 Find
1 Use the Locate command to quickly find files and folders, this command must be established in advance database, the database updated once a day
We can use UpdateDB for manual updates.
2 Use Find command advanced search, powerful real-time search command, can support multiple conditions lookup, but slow
Find Lookup Location Lookup parameter
7 CD command switch working directory
1 PWD----View current working directory
2 CD ~----back to User home directory
3 CD. ----go back to the previous level directory
4 cd-----Back to the last working directory
5 cd/----Back to the root directory