The Linux system commonly used commands

First, the date and time

1, date view, set the current system time

       Display time format: +% Y -% m -% d

      date -s "modified time": the modification time

2, hwclock (clock) for displaying the hardware clock time

3, cal: View Calendar

4, upitime: View system uptime

Second, the output of the view command

1, echo: displays the contents of the input

2, cat: show the file contents

3, head: displays the first few lines (default ten lines) file

    -n specifies the maximum number of lines

4, tail: display a few lines at the end of the file (the default ten lines)

  -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)

5, more: page display file contents (only page down)

6, less: page display file contents (to bring the page)

 

Third, view hardware information

1, ispci: View PCI devices

   For more information see -v production

2, isusb: view usb device

   For more information see -v production

3, ismod: View loaded modules (Driver)

Fourth, shutdown, restart

1、shutdown 

-h

-r

Immediate shutdown: shutdown -h now

Ten minutes later shutdown: shutdown -h 10

23.30 minutes Shutdown: shutdown -h 23:30

Restart immediately: shutdown -r now

2, power off: immediate shutdown 

      reboot: Restart immediately

Fourth, archiving, compression

1, zip: compressed files

zip.linuxcast.zip myfile (for compressed files)

2, unzip: unzip the file

unzip linuxcast.zip

3, gzip: compressed files

gzip linuxcast.net

4, tar: archive

tar -cvf out.tar linuxcast 

tar -xvf linuxcast.tar

tar -cvzf backup.tar.gz / etc -z parameter archive files gzip compression to reduce the large

Fifth, find

1, locate: Oh tea fast axis files, folders

     locate  keyword

   This command requires pre-established database, the default database is updated once a day, can updatedb command manually creating, updating database

2, find: Advanced Find files, folders

     Find find find the location parameters

Such as:.. Find -name * linuxcast * Find -name ** represent multiple characters in the current file

        find / -name * .conf Find all * .conf indicate to the end of the conf file in the root directory

        find / -perm 777 -perm 777 Find the file permissions to 777

        find / -type d return all listings

        find . -name "a*" -exec is -l {}\;

      

        find -group

        find  -ctime

        find  -size

 

Published 26 original articles · won praise 4 · views 10000 +

Guess you like

Origin blog.csdn.net/weixin_41926640/article/details/83535342
Recommended