Linux basic commands

Source: Internet
Author: User

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:

    1. Command function: List Directory contents
    2. Command format: LS [options] ... File
    3. 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

    1. Command function: Displays the current working directory
    2. Command format: pwd "Options"
    3. 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:

    1. Command function: Switch directory
    2. Command format: CD [directory name]
    3. Instance

      Cd/

      cd/etc/passwd

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/EB/wKioL1Xa497S8qRAAAAzQBg29AU484.jpg "/>

Linux basic commands

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.