[mycentos64@localhost so]$ date--help
Usage: date [OPTION]... [+FORMAT]
or: date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
Display the current timeinthegiven FORMAT, orsetthe system date.
-d, --date=STRING display time described by STRING, not `now'
-f, --file=DATEFILE like --date once for each line of DATEFILE
-r, --reference=FILE display the last modification time of FILE
-R, --rfc-2822 output date and time in RFC 2822 format--rfc-3339=TIMESPEC output date and time in RFC 3339 format.
TIMESPEC=`date', `seconds', or `ns' fordateandtimetothe indicated precision.
-s, --set=STRING set time described by STRING
-u, --utc, --universal print or set Coordinated Universal Time--help display this help and exit--version output version information and exit
FORMAT controls the output. The only valid option forthesecond form
specifies Coordinated Universal Time. Interpreted sequences are:
%% a literal %
%a locale's abbreviated weekdayname (e.g., Sun)
%A locale's full weekdayname (e.g., Sunday)
%b locale's abbreviated monthname (e.g., Jan)
%B locale's full monthname (e.g., January)
%c locale's dateandtime (e.g., Thu Mar 323:05:252005)
%C century; like %Y, except omit last two digits (e.g., 21)
%d dayofmonth (e.g, 01)
%D date; same as %m/%d/%y
%e dayofmonth, space padded; same as %_d
%F full date; same as %Y-%m-%d
%g last two digits ofyearof ISO week number (see %G)
%G yearof ISO week number (see %V); normally useful only with %V
%h same as %b
%H hour (00..23)
%I hour (01..12)
%j dayofyear (001..366)
%k hour ( 0..23)
%l hour ( 1..12)
%m month (01..12)
%M minute (00..59)
%n a newline
%N nanoseconds (000000000..999999999)
%p locale's equivalent of either AM or PM; blank ifnot known
%P like %p, but lower case
%r locale's 12-hour clock time (e.g., 11:11:04 PM)
%R 24-hour hour and minute; same as %H:%M
%s seconds since1970-01-0100:00:00 UTC
%S second (00..60)
%t a tab
%T time; same as %H:%M:%S
%u dayof week (1..7); 1is Monday
%U week numberofyear, with Sunday asfirstdayof week (00..53)
%V ISO week number, with Monday asfirstdayof week (01..53)
%w dayof week (0..6); 0is Sunday
%W week numberofyear, with Monday asfirstdayof week (00..53)
%x locale's date representation (e.g., 12/31/99)
%X locale's time representation (e.g., 23:13:48)
%y last two digits ofyear (00..99)
%Y year
%z +hhmm numeric timezone (e.g., -0400)
%:z +hh:mm numeric timezone (e.g., -04:00)
%::z +hh:mm:ss numeric time zone (e.g., -04:00:00)
%:::z numeric time zone with : to necessary precision (e.g., -04, +05:30)
%Z alphabetic time zone abbreviation (e.g., EDT)
By default, date pads numeric fields with zeroes.
The following optional flags may follow `%':
- (hyphen) do not pad the field
_ (underscore) pad with spaces
0 (zero) pad with zeros
^ use upper case if possible
# use opposite case if possible
After any flags comes an optional field width, as a decimal number;
then an optional modifier, which is either
E to use the locale's alternate representations if available, or
O to use the locale's alternate numeric symbols if available.
Report bugs to <bug-coreutils@gnu.org>.
查看文件信息
[mycentos64@localhost so]$ stat --help
Usage: stat [OPTION] FILE...
Display fileorfile system status.
-L, --dereference follow links
-Z, --context print the security context information if available
-f, --file-system display file system status instead of file status
-c --format=FORMAT use the specified FORMAT instead of the default;
output a newline after each useof FORMAT
--printf=FORMAT like --format, but interpret backslash escapes,and do not output a mandatory trailing newline.
If you want a newline, include \n in FORMAT.
-t, --terse print the information in terse form--help display this help and exit--version output version information and exit
The valid format sequences for files (without --file-system):
%a Access rights in octal
%A Access rights in human readable form
%b Number of blocks allocated (see %B)
%B The size in bytes of each block reported by %b
%d Device number in decimal
%D Device number in hex
%f Raw mode in hex
%F Filetype
%g Group ID of owner
%G Group name of owner
%h Number of hard links
%i Inode number
%n File name
%N Quoted file name with dereference if symbolic link
%o I/O block size
%s Total size, in bytes
%t Major device typein hex
%T Minor device typein hex
%u User ID of owner
%U User name of owner
%x Timeof last access
%X Timeof last access as seconds since Epoch
%y Timeof last modification
%Y Timeof last modification as seconds since Epoch
%z Timeof last change
%Z Timeof last change as seconds since Epoch
Valid format sequences forfile systems:
%a Free blocks available to non-superuser
%b Total data blocks infile system
%c Total file nodes infile system
%d Free file nodes infile system
%f Free blocks infile system
%C Security contextin SELinux
%i File System ID in hex
%l Maximum length of filenames
%n File name
%s Block size (for faster transfers)
%S Fundamental block size (forblock counts)
%t Typein hex
%T Typein human readable form
NOTE: your shell may have its own version of stat, which usually supersedes
the version described here. Please refer to your shell's documentation
for details about the options it supports.
Report bugs to <bug-coreutils@gnu.org>.
修改文件时间
[mycentos64@localhost so]$ touch --help
Usage: touch [OPTION]... FILE...
Update the accessand modification times of each FILEto the current time.
Mandatory arguments to long options are mandatory for short options too.
-a change only the accesstime
-c, --no-create do not create any files
-d, --date=STRING parse STRING and use it instead of current time
-f (ignored)
-m change only the modification time
-r, --reference=FILE use this file's times instead of current time
-t STAMP use [[CC]YY]MMDDhhmm[.ss] instead of current time--time=WORD change the specified time:
WORD isaccess, atime, oruse: equivalent to -a
WORD is modify or mtime: equivalent to -m
--help display this help and exit--version output version information and exit
Note that the -d and -t options accept different time-date formats.
If a FILEis -, touch standard output.
Report bugs to <bug-coreutils@gnu.org>.