linux basic commands ②

This chapter is about the time-related commands, command much, not many commonly used, but still good idea to write about

Talk about the date command and the clock command, these two commands are viewing linux system time and hardware time, the command is as follows:

date command:

Here Insert Picture Description
date: time management
date 0226104913.30: modified time at 10:49:30 on February 26, 2013
date +% Y: display of
date +% d: show days
date +% T: Display hours minutes seconds
date +% F: the date display
date +% Y% m% d // display the current date days
after a day's date +% Y% m% d --date = "+ 1 day" // dATE
date +% Y% m % d --date = "- 1 day " // display the previous day
date +% Y% m% d --date = "- 1 month" // display the date January
date +% Y% m% d --date = "+ 1 month" // display the date of the next month
date +% Y% m% d --date = "- 1 year" // display the date one year before the
date +% Y% m% d --date = "+ 1 year" // display the date one year

clock

: View hardware time

Here we are talking about access hwclock command, which remember enough to use two basic options

hwclock

hwclock -w: change the system time to hardware time
hwclock -s: the system time is changed to hardware time

Guess you like

Origin blog.csdn.net/fanyanluohua/article/details/92423997