Linux Self-Study notes (5): Linux basic commands

Source: Internet
Author: User
Tags locale

Basic command:
Date:date--help
Usage: date [options] ... [+ format]
Or: Date [-u|--utc|--universal] [MMDDHHMM[[CC]YY][-SS]]
Date [MMDDHHMM[[CC]YY][-SS]]: Set
MM: Month
DD: Day
HH: When
MM: Min
YY: two-digit year
CCYY: four-bit year
-ss: Seconds

Two types of clocks for Linux
System clock: The timing of the CPU's operating frequency by the Linux kernel;
Hardware clock:
Huclock: Display Hardware clock
-s,--hctosys
-w,--systohc

        cal:日历            cal 2018 年历

Directory-related commands:
Working directory for current directory
Home directory: Family directory: Home
Root:/root
Normal User:/home/username

    ~用户主目录

Cd:
CD or CD ~: Back to the current user's home directory
CD ~ USERNAME: Switch to the home directory of the specified directory
CD ~: Switch back and forth between the previous directory and the current directory

相关的环境变量    PWD:保存了当前目录路径    OLDPWD:上一次所在的目录路径

PWD: Show current directory

Ls:list
Displays a list of files under the path path

Usage: LS [option] ... [File] ...
-A,--all does not hide anything. Start of Project
-L: Long format
-H: Unit conversion
-D: View the directory's own related properties to use with-l
Dr-xr-xr-x. 5 root root 4096 January 16:01 boot
First bit: File type
Second to Nineth bit: access rights
Number: The number of times a file has been hard-linked;
First Root: The owner of a file
Second Root: The genus Group of a file
4096: Size of the file
January 16:01 Boot: The time the file was last modified

stat /PARHTO/SOMEFILE:获取指定文件的元数据

File View command:
Cat, TRC
Usage: cat [options] ... [File] ...
-E,--show-ends displays "$" at the end of each line
File content view command: Files
File/

Echoing command: Echo
[email protected] ~]# help Echo
Echo:echo [-nee] [parameters ...]
Writes the parameters to standard output.

在标准输出上显示 ARG 参数后跟一个换行。选项:  -n    不要追加换行  -e    启用下列反斜杠转义的解释  -E    显式地抑制对于反斜杠转义的解释
    • ' Echo ' escapes the following backslash characters:
      \a Warning (Bell)
      \b Backspace
      \c suppresses more output
      \e Escape character
      \f Format provides
      \ nthe line break
      \ r Enter
      \ t Transverse tab
      \v Portrait tab

echo "$VAR _name": variable is substituted, double-cited indicates weak reference
Echo ' $VAR _name ': variable does not replace, strong reference

[Email protected] ~]# Whatis--help
Usage:whatis [OPTION ...] keywords ...

-D,--debug output debug information
-V,--verbose output verbose warning message
-R,--regex each keyword as a regular expression
-W,--wildcard keyword contains wildcard characters
-L,--long do not truncate the output by the end width
-C, the--config-file= file uses the user settings file
-L,--locale= region defines the locale used for this search
-M,--systems= system use manual pages from other systems
-M,--manpath= path Setting the path to the Search man page is "path"
-S,--sections= list,--section= list
Search only these sections (colon-separated)
-?,--help give this help list
--usage give a short usage message
-V,--version print program version

Whatis
Oh, yes, that whatis. command to create a database of all the help manuals for the current system and the corresponding keywords;

Linux Self-Study notes (5): 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.