I. Date and time
Command date to view, set the current system time:
Date-u GMT Date%y-%m-%d Display formatted time date-s "23:00" with- s parameter set, modified time
Command hwclock or clock to display hardware clock time
Command cal View calendar
Command uptime to view system boot time or system load (last 1 minutes, 5 minutes, 15 minutes of load)
Second, output, view command
Command Echo echoes the input content
Command cat to display file contents
Command Head displays the first few lines of the file (default 10 lines)
Command tail display the end of a file (default 10 lines)
- -n Specifies the number of rows to display
- -F parameter Tracking displays file updates (typically used to view the log, the command does not exit, but continues to show the latest content)
Command More page to display the contents of the file (only page Down)
Command less page to display file contents (can page up and down)
Iii. viewing hardware-related information
Command Lspci to view PCI devices
Command Lsusb to view USB devices
Command lsmod view the loaded module (driver)
Four, shutdown, restart
Command shutdown to shut down and restart the computer:
- -F Turn off the computer
- -R Restart the computer
- ...
Such as:
Immediate shutdown: shutdown-h now10 minutes after shutdown: shutdown-h +1023:30: shutdown-h 23:30 Restart now: shutdown-r
Command Poweroff to shut down the computer immediately
Command reboot to restart the computer immediately
V. Archive, Compress
Command Zip compressed file:
Zip New.zip myfile
Command Unzip unzip the zip file:
Unzip New.zip
Command gzip compressed files:
Gzip MyFile
Command tar archive file:
TAR-CVF New.tar myfile file archive. Archive myfile to NEW.TARTAR-XVF new.tar unlock archive tar-cvzf new.tar.gz/etc archive/etc directory, archive named new.tar.gz. -Z parameter means gzip compression after archiving to reduce size
Note that the target file suffix for archive compression command TAR-CVZF must be . tar.gz
Six, find
Command Locate quickly find files, folders:
Locate keyword
The command requires a pre-established database, the database is updated daily by default, and the database can be manually established and updated with the updatedb command.
Command Find advanced Locate file, folder:
Find Find Location Lookup parameters
Such as:
Find. -name *test* in the current directory find the file name that contains "test" Find/-name *.conf in the root partition look for all ". conf" configuration file Find/-perm 777 in root partition lookup permission is 777 The file Find/-type D finds all directories found in the root partition find.-name A *-exec ls-l {}\; Find the directory whose name begins with "a" in the current directory and invoke the Ls-l command on it
Vii. Find search criteria
The Find command supports a wide variety of search criteria, which are commonly used as follows:
-name qualified file name-perm qualified permission-user qualified user-group qualification of a specific group-ctime limit modification time-type qualified files type-size Limit file Size
Linux entry record: Four, Linux system common commands