Date command
1. Command function: The date command can be used to display or set the system's dates and times.
2. Command format: Date [options] ... Format
3. Command parameters:
-D Displays the date and time that the string refers to
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/EB/wKioL1Xa49HgqglTAAA4WLb9vDQ187.jpg "/>
-R Displays the last time the file was modified
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/EF/wKiom1Xa4b2xB8pzAAA9MZvcHp4205.jpg "/>
-r displays time in rfc-2822 format
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/EB/wKioL1Xa49LCWkfBAAAxeT94HLg502.jpg "/>
-S sets the time based on the string
--HELP Display Help information
--version displaying version information
4. Format:
%a Show abbreviated Week
650) this.width=650; "align=" left "src=" http://s3.51cto.com/wyfs02/M00/71/EF/wKiom1Xa4b6htV2sAAAeIm77tBc635.jpg "/ >
%A shows the full week
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/EB/wKioL1Xa49PRHOIjAAAevfACDfc903.jpg "/>
%b Display Month
%B Show Full Month
650) this.width=650; "align=" left "src=" http://s3.51cto.com/wyfs02/M01/71/EF/wKiom1Xa4b_SvbcOAAA7w-l1bso458.jpg "/ >
%d which day
%d Full Date m/d/y
%F Full Date y-m-d
%H hours
%m Month
%M Show minutes
5. Time setting
Date S//Set current time, root permission to set
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/EB/wKioL1Xa49TRz4JqAACAovDdD60522.jpg "/>
6.date D Example:
650) this.width=650; "align=" left "src=" http://s3.51cto.com/wyfs02/M02/71/EF/wKiom1Xa4cHx0cLdAADX8_GCh00288.jpg "/ >
Date-d "Nov22" This year's November 22 is Wednesday
Date-d ' 2weeks ' 2 weeks after the date
Date-dnext-day+%y%m%d (tomorrow's date) or: date-dtomorrow+%y%m%d
date-dlast-day+%y%m%d (yesterday's date) or: date-dyesterday+%y%m%d
Cal Command:
1. Command function: The CAL command can be used to display the calendar.
2. Command format: cal [parameters] [year | month]
3. Command parameters:
-1 show a single month
-3 shows the first one months, the current month, the next one months
-S displays Sunday for the first day of one weeks
-M displays Monday for the first day of one weeks
-j show the day of the year
-y Displays the calendar for the current year
-V Version Information
4.cal instance:
Displays the current date, showing the last three months, showing 2015 years
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/EB/wKioL1Xa49fRjQQDAAGbZSADAY4103.jpg "/>
Show today is the day of the Year:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/EB/wKioL1Xa49eSmqVmAACjAj4CEqo065.jpg "/>
ls command:
- Command function: List Directory contents
- Command format: LS [options] ... File
- Parameters:
-A shows all files including hidden files that begin with.
-A is not displayed. And..
-l output in long format
-H in a human-readable way
-S display file size
-s sort by file size
4.ls instance:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/EF/wKiom1Xa4cXTvhalAAKBOUcn4Wk380.jpg "/>
Sort by file Size:
PWD command
- Command function: Displays the current working directory
- Command format: pwd "Options"
- Command parameters:
-l display path (including connection)
-P shows the actual path
4. Example:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/EF/wKiom1Xa4cngP1nqAACCurzrj9E987.jpg "/>
CD command:
- Command function: Switch directory
- Command format: CD [directory name]
- Instance
Cd/
cd/etc/passwd
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/EB/wKioL1Xa497S8qRAAAAzQBg29AU484.jpg "/>
Linux basic commands