Linux System common commands

Source: Internet
Author: User
Tags zip

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.