Linux Learning Commands Summary ②

Source: Internet
Author: User

#shutdown命令: System shutdown, restart, etc.

shutdown [Options] ... Time

Time:now (immediately) +# (after how many minutes) hh:mm (a few moments)

The system shuts down after five minutes:

[[Email Protected]_168_102_centos ~]# shutdown 5//System restarts after 5 minutes broadcast message from [email protected]_168_102_centos (/dev /pts/0) at 16:19 ... The system is going down for maintenance in 5 minutes!//countdown ^cshutdown:shutdown cancelled//catrl+c Cancel operation

The system will turn off at 15:15:

[[Email Protected]_168_102_centos ~]# shutdown 15:15//15 Point 15 points system shutdown broadcast message from [email protected]_168_102_ CentOS (/dev/pts/0) at 16:22 ... The system is going down for maintenance in 1373 minutes!//Countdown ^cshutdown:shutdown cancelled

Shutdown–r: Restart

The system will restart after 10 minutes:

[[Email Protected]_168_102_centos ~]# shutdown-r 10//10 minutes after restart broadcast message from [email Protected]_168_102_centos (/ dev/pts/0) at 16:25 ... The system is going down for reboot in minutes!//Countdown ^cshutdown:shutdown cancelled

Shutdown-h (Halt): Power off

The system shuts down after five minutes:

[[Email Protected]_168_102_centos ~]# shutdown-h 10//10 minutes after shutdown broadcast message from [email Protected]_168_102_centos (/ dev/pts/0) at 16:37 ... The system is going down for halt in minutes!//Countdown ^cshutdown:shutdown cancelled

Power off after shutdown

Halt: Actually halt is called shutdown-h. When the halt executes, the application process is killed, the sync system is called, and the kernel is stopped after the file system write operation is complete.

#data命令: The date and time that can be used to display or set the system

View current date and time:

#date

[[Email Protected]_168_102_centos ~]# datesun  3 16:58:22 CST 2014

View current Date:

#date +%d

[Email protected]_168_102_centos ~]# Date +%d 08/03/14    //August 3, 14

#date +%F

[Email protected]_168_102_centos ~]# Date +%f2014-08-03//August 3, 2014

View Current year:

#date +%y

[[Email protected]_168_102_centos ~]# Date +%y2014     //show four-bit year

#date +%y

[[Email protected]_168_102_centos ~]# Date +%y14   //show two-bit year

View Current Month

#date +%m

[Email protected]_168_102_centos ~]# Date +%m08  

View current date

#date +%d

[Email protected]_168_102_centos ~]# Date +%d03

See when the current moment is a few seconds

# date +%h%m%s

[[Email protected]_168_102_centos ~]# Date +%h%m%s173953    //17 points 39 minutes 53 seconds

View current month day minute seconds ( date time can be custom interval symbol )

#date +%y%m%d%h%m%s

[[Email protected]_168_102_centos ~]# Date +%y%m%d%h%m%s20140803174148   //August 3, 2014 17:41 48 sec

#date +%y-%m-%d%h-%m:%s

[Email protected]_168_102_centos ~]# Date +%y-%m-%d-%h:%m:%s2014-08-03-17:46:53//display mode

#date +%y/%m/%d/%h:%m:%s

[Email protected]_168_102_centos ~]# Date +%y/%m/%d/%h:%m:%s2014/08/03/17:48:52   //display mode

Modify the current date

#date –s-month-day (2014-08-03)

[Email protected]_168_102_centos ~]# date +%f2014-08-02[[email protected]_168_102_centos ~]# date-s 2014-08-03Sun Aug< C3/>3 00:00:00 CST 2014[[email protected]_168_102_centos ~]# Date +%f2014-08-03

Modify the current time

#date –s: minutes: seconds (17:55:00)

[[Email Protected]_168_102_centos ~]# datesun  3 18:55:06 CST 2014[[email protected]_168_102_centos ~]# date-s 17: 55:00sun  3 17:55:00 CST 2014

Modify the current date and time

[Email protected]_168_102_centos ~]# date +%y-%m-%d-%h:%m:%s2013-07-02-14:56:03[[email Protected]_168_102_centos ~] # date-s "2014-08-03 17:59:57" Sun  3 17:59:57 CST 2014[[email protected]_168_102_centos ~]# Date +%y-%m-%d-%h:%m:% s2014-08-03-17:59:59

Date and time are modified together Shuga "year-month-day time: minutes: Seconds", date and time with an empty interval

Large-Scale Price Reduction
  • 59% Max. and 23% Avg.
  • Price Reduction for Core Products
  • Price Reduction in Multiple Regions
undefined. /
Connect with us on Discord
  • Secure, anonymous group chat without disturbance
  • Stay updated on campaigns, new products, and more
  • Support for all your questions
undefined. /
Free Tier
  • Start free from ECS to Big Data
  • Get Started in 3 Simple Steps
  • Try ECS t5 1C1G
undefined. /

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.