Common Commands Linux learning (3/22)

Common Commands

Command date for viewing, set the current system time:

Display time format: + the Y% -% m -% D

 

Command hwclock (clock) for displaying the hardware clock time

Command cal to view the calendar

Command uptime for viewing system uptime

 

Output, view the command

Command echo for information to be displayed

Command cat to display the contents of the file

 

Command head first few lines to display the file (the default is 10 rows)

-n specifies the maximum number of lines

-f   trace display file updates (generally used to view the log, the command will not quit, but continues to display the contents of the newly added)

Command more to display file contents page (only page down)

Command less for page display file contents (to bring the page)

 

 

View hardware information

 

Command lspci for viewing PCB equipment

-V View Details

 

Command lsusb to view the USB device

-V View Details

 

Command lsmod to view the module loaded (drive)

 

 

Shutdown , Restart

Command shutdown to shut down, restart your computer

Shutdown [ shutdown, restart ] Time

-h Turn off the computer

-r Restart

 

Such as:

Immediate shutdown: the shutdown -h now

10 minutes after the shutdown shutdown -h +10

23:30 min shutdown: the shutdown -h 23:30

Restart immediately: the shutdown -r now

Command poweroff to shut down the computer immediately

Command reboot to restart the computer immediately

Archiving , compression

Command zip for zip file

zip linuxcast.zip myfile

Command unzip to extract the zip file

unzip linuxcast.zip

Command gzip to compress files

gzip Linuxcast.net

Command taz to archive

taz -cvf out.taz linuxcast

taz -xvf linuxcst.tar

Tar -cvzf  backup.taz.gz/etc

 

Seek

Command locate to quickly find files, folders

Loate keyword

This command requires pre-established database, the default database is updated once a day, can update command to manually create, update database

 Command find for Advanced Find files, folders,

Find Find Find a location parameter

Such as:

find   find find the location parameters

Such as:

Find  . -name *linuxcast*

Find / -name *.conf

Find / -perm 777

Find /-type d

Find .-name “a*” -exec is -i{}\;

 

 

Guess you like

Origin blog.csdn.net/lieanwan2780/article/details/79661586