About the format and usage of some Linux commands (Linux Employment Class second assignment)

Source: Internet
Author: User
Tags parent directory

Common basic Commands:

cd command: Change directory

CD [/path/to/somewhere]

Cd

CD ~: Back to home directory

CD ~username: Switch The home directory for the specified user

CD-: Go back to your previous directory


Related environment variables:

Pwd:

OLDPWD:


PWD command: Printing working directory

Show working directory


Ls:list

Lists the property information for a file or directory under a specified path


Metadata: Attribute Data

Data:


ls [OPTION] ... [FILE] ...

-L: Display with long format

Drwxr-xr-x 1 root root 8 08:47. cache

D: File type

Rwxr-xr-x: Permissions, Mode

1: Number of times a file has been hard linked

Root:owner, belonging to the Lord;

Root:group, genus Group

8:size, Default is byte

23 08:47 Modify Timestamp

. cache: File name

-D: Display the directory's own properties

-h:human-readable

-A: Displays all files, including. Start hidden files

.: Current Directory

..: Parent Directory

-r:reverse, Reverse display

-r:recusive, recursive


Text file view commands for the class:

Cat, TAC Command:

Cat [OPTION] ... [FILE] ...

-N:

-E:-ve

-E: Display line terminator

-V: Display nonprinting characters


File content Type view command:

File/path/to/somewhere


Echoing command: Echo

echo [OPTION] ... [ARGS] ...

-N: No line break;

-e: Allow the control to take effect;

\n:new Line

echo "$VAR _name"


Command path location View tool:

Whereis, which


Which:

which [options] [--] programname [...]

--skip-alias: Prohibit listing aliases


Whereis COMMAND:

Displays the path to the binaries, source files, and help manuals;


Time-related commands:

Rtc:realtime Clock

System clock: Systems clocks


Date: System time

Clock, Hwclock: Hardware time


Date

Date [OPTION] ... [+format]: Time display

FORMAT

%F

%d

%T

%H

%M

%s

Date [MMDDHHMM[[CC]YY][.SS]]: Time setting


Hwclock

-s:hctosys, with hardware clock as the standard, adjust the system time with the hardware;

-W:SYSTOHC, whichever is the system clock


Cal:

Cal [year]


Shutdown or restart

shutdown: Halt, Poweroff, Init 0, shutdown-h time

restart: reboot, init 6, Shutdown-r time


shutdown

shutdown [OPTIONS ...] [TIME] [WALL ...]

-R: Restart

-H: Shutdown

--no-wall

-C


Time:

+m: The corresponding operation is performed after the relative length, and the unit is minutes;

hh:mm Absolute Time


Stat

W, who, WhoAmI


About the format and usage of some Linux commands (Linux Employment Class second assignment)

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.