02_02 linux operating system and commonly used commands

One,

The first is the date command

%Command option arguments

Command to get help through the man command, then found date has two functions:

1, check the time, the display format can achieve what you want by blending options

2, set the time

% As well as internal command help command, external command command help.

% Linux shell internal command with an external command What are the differences and how to identify https://www.cnblogs.com/gavinpan/p/11248279.html

% Type displays the type of command.

 

% Builtin built

two,

Man: manual command manual

Sub-chapter manual requires%

1, the user command (/ bin, / usr / bin, / usr / local / bin)

2, the system call

3, library users

4, special file (device file)

5, file format

6, game

7. Miscellaneous (Miscellaneous)

8, management commands (/sbin,/usr/sbin./usr/loacl/sbin)

% Whatis command can be viewed through the first few chapters belonging to this command

How help documentation% after the man command (if the English ten I think is OK),

NAME: command name and Features

SYNOPSIS: Usage Notes, including the options available

DESCRIPTION: detailed description of the command function, and may include the meaning of each option

FILES: This command related configuration files

BUGS:

EXAMPLES: Example of use

SEE ALSO: additional reference

% Used button when viewing the document:

Scroll:

   Turned back one screen: SPACE

   The flip ahead a screen: b

   Backward line: ENTER

   The flip ahead a row: k

Find:

/ KEYWORD: back

n: Next

N: previous

? KEYWORD: forward

n: Next

N: previous

q: quit

Third, the configuration related to some open source projects can use google to search

%apache hadoop

% With respect to time there is a command hwclock:

-s, --hctosys

Set the System Time from the Hardware Clock.Also  set  the  kernel's  timezone  value to the local timezone as indicated by the TZ environment variable  and/or  /usr/share/zone‐info,  as  tzset(3) would interpret them.  The obsolete tz_dsttime field of the kernel's timezone value is  set  to  DST_NONE.(For details on what this field used to mean, see settimeofday(2).)This is a good option to use in one of the system startup scripts.

-w, --systohc

Set the Hardware Clock to the current System Time.

Hardware Hardware

four,

% Cal: display a calendar with the

Fifth, work

Exercise:

1, echo command is internal or external command?

[root@linuxprobe ~]# type echo

echo is a shell builtin

2, its role?

[root@linuxprobe ~]# help echo | [root@linuxprobe ~]# man help

% Output display standard in a new line in

3, how to display "The year is 2013. Today is 26." two lines?

[root@linuxprobe ~]# echo -e "the year os 2020.\ntoday is 25"

the year os 2020.

today is 25

Escape, escape

 

Exercise:

1, printf command is internal or external command?

[root@linuxprobe ~]# type printf

printf is a shell builtin

2, its role?

Formats and prints ARGUMENTS under control of the FORMAT.

Format and print ARGUMENTS under control of FORMAT

3, how to display "The year is 2013. Today is 26." two lines?

 

[root@linuxprobe ~]# printf "the year is 2013.today is 25"

the year is 2013.today is 25[root@linuxprobe ~]# printf "the year is 2013.\ntoday isthe year is 2013.

today is 25

4, file commands and their usage.

[root@linuxprobe ~]# type file

file is /usr/bin/file

[root@linuxprobe ~]# file --help

Usage: file [OPTION...] [FILE...]

Determine type of FILEs.

 

      --help                 display this help and exit

  -v, --version              output version information and exit

  -m, --magic-file LIST      use LIST as a colon-separated list of magic

                               number files

  -z, --uncompress           try to look inside compressed files

  -b, --brief                do not prepend filenames to output lines

  -c, --checking-printout    print the parsed form of the magic file, use in

                               conjunction with -m to debug a new magic file

                               before installing it

  -e, --exclude TEST         exclude TEST from the list of test to be

                               performed for file. Valid tests are:

                               ascii, apptype, compress, elf, soft, tar, tokens, troff

  -f, --files-from FILE      read the filenames to be examined from FILE

  -F, --separator STRING     use string as separator instead of `:'

  -i, --mime                 output MIME type strings (--mime-type and

                               --mime-encoding)

      --apple                output the Apple CREATOR/TYPE

      --mime-type            output the MIME type

      --mime-encoding        output the MIME encoding

  -k, --keep-going           don't stop at the first match

  -l, --list                 list magic strength

  -L, --dereference          follow symlinks (default)

  -h, --no-dereference       don't follow symlinks

  -n, --no-buffer            do not buffer output

  -N, --no-pad               do not pad output

  -0, --print0               terminate filenames with ASCII NUL

  -p, --preserve-date        preserve access times on files

  -r, --raw                  don't translate unprintable chars to \ooo

  -s, --special-files        treat special (block/char devices) files as

                             ordinary ones

  -C, --compile              compile file specified by -m

  -d, --debug                print debugging messages

 

Guess you like

Origin www.cnblogs.com/shareformlwh/p/12571640.html
Recommended