Learning Journey to Linux

Source: Internet
Author: User
Tags keyword list sessions

Linux file system hierarchy standard FHS

    • /etc===== and host-related system configuration file edit the Configure
    • /home===== User Home Directory
    • /usr====== a two-tier hierarchical directory. The default is the largest.
    • /dev===== Device files
    • /media====== mount points and removable devices,
    • /mnt===== Temporary mount point
    • /var======= data that can be changed,
    • /lib===== Basic shared libraries and kernel modules
    • /lib64======
    • /boot====== static files, boot loader, boot computer related files
    • /root=====root User's home directory
    • /bin/binary====== Basic Binary Command tool
    • /sbin===== Basic System Binary Command tool
    • /opt====== third-party packages
    • /tmp====== temp File
    • /srv====== is stored in the data provided by your system service.
    • /run======7 in/Under, 6 in/VAR is the system running some data
    • /sys===== Storing hardware-related information
    • The/proc======= stores the process information, which corresponds to the memory data. The strong state information in memory. is a virtual memory.
The difference between the first-level directories of CENTOS7 and CENTOS6

CentOS 7:/run
CentOS 6:/var/run/lost-found/misc/net/selinux
Lost-found======= in 6, as long as there is a directory under the partition
A bit like a shelter, such as the system operation, suddenly power outages, some files because of the cause of power failure to identify the original is in which directory, can not find, do not know where they are. We'll go back to this directory.
/misc/net======= to install packages on 7, not without.
systemctl start AutoFS====== just temporary boot, manual start
systemctl enable AutoFS====== start automatically when powered on
CD directories under /misc can also be mounted on a CD.
/selinux======== does not have this directory on 7, but features

The philosophical thought of Linux
    • All documents
    • Small single-use programs
    • Combine small programs to complete complex tasks
    • Try to avoid capturing the user interface
    • The configuration file is saved in plain text format

Terminal Terminal

    • Physical Terminal : System failure, single user strong State, physical console console is represented as /dev/console
    • Pseudo-terminal : With CRT connection, Xshell. /dev/pts/#
    • Virtual Terminal : One host simulates multiple terminals. The default is 1-6. /dev/tty#
    • Serial terminal : Connect your computer via a serial line. (like Cisco Huawei connected to its own on-machine) /dev/ttys#
    • ......
Terminal-related commands

TTY: Displays the current terminal
WHOAMI command
WhoAmI: Displays the currently logged in active user
Who : all current logon sessions for the system
W: All current logon sessions and actions made by the system

Command Help
Whatis  显示命令的简短描述        使用数据库        刚安装后不可立即使用        makewhatis | mandb制作数据库        whatis cal 或 man -f cal如果刚装好系统和刚运行,敲whatis这个命令是不会显示的。要依赖数据库whatis cmd=======告诉你这个命令是干什么的数字后带P的和开发相关,运维不用管whatis要显示命令的简单说明要依赖数据库

internal command:help command
Mans Bash
External command:
(1) COMMAND--help
Command-h
(2) User manual (manual)
Mans COMMAND
(3) Information page
Info COMMAND
(4) Help documentation for the program itself
Readme
INSTALL
ChangeLog
(5) Official program document
Official site: Documentation
(6) Official documents of the release version
(7) Google

Example

Date--help
Usage:date[option] ... [+FORMAT]OR:DATE[-U|--UTC|--UNIVERSAL][MMDDHHMM[[CC]YY][.SS]]

    • [] indicates an option
    • Caps or <> indicates changes in data
    • ... Represents a list
    • X |y| Z means "x or Y or z"
    • -abc means-a-b–c.
    • {} means grouping
Man command

Man command Help file manual page on/usr/share/man
Almost every command has a man's "page"
The man page is grouped into different "chapters" collectively referred to as the Linux manual
Configuration file for man command:/etc/man.config | Man_db.conf
Manpath/path/to/somewhere: Indicates the man file search location
Man-m/path/to/somewhere command: Searches the command command's hand pages to the specified location and displays
Chinese man needs to install package MAN-PAGES-ZH-CN

Whereis cmd======= isolate the path to the command and the path of the man Help-related document (viewed in the man's config file)
Documents detected are compressed files and cannot be opened directly. When you open with the Man command, it automatically helps you unpack it in the form of a document.
Why do you knock on a man to open the help??? In fact, it opens the corresponding man help document. To search from a path.
This has a potential problem: in the future we will manually to install a three-party software, the result of the man to help put in a directory of their own, man help will not open, you need to manually add a path to the man's configuration file.

Man help general Check External command
External command It is a file on disk
When this external command is installed, some man-help documents are also installed automatically
When we have a man external command, it is the information listed in the document.

Man Chapter

1: User command
2: System call
3:C Library Call
4: Equipment files and special files
5: Configuration file format
6: Game
7: Miscellaneous
8: Management class commands
9:linux Kernel API

The paragraph description in the Help manual:

Name and brief description
Synopsis Usage Format description]
[] Optional content
<> Required Content
A | b Two Choose one
{} grouping
... The same content can appear multiple times
DESCRIPTION Detailed description
Options description
EXAMPLES Example
Files Related Documents
AUTHOR author
Copyright Version Information
REPORTING BUGS Bug Information
See ALSO other Help references

Man Help
View man manual page man [Chapter] keyword
List all help man-a keyword
Search man manual man-k keyword list all matching pages
Using the Whatis database
Equivalent to Whatis man-f keyword
Print the path to the man Help file Man–w [Chapter] Keyword

Man help /string down search? string up search n inverse n
Info help N to move up one layer above p

History of the Command

The command history file saves the command history you entered. You can use it to repeat the command.
When you log in to the shell, the commands that are recorded in the command history file are read ~/.bash_history
The newly executed command logged into the shell is only recorded in the cache, and the commands are "appended" to the command history file when the user exits.

There are 4 ways to repeat the previous command
!! Ctrl+p!! !-1

Syntax format
History [-c] [-D offset] [n]
HISTORY-ANRW [FileName]
History-ps arg [arg ...]

    • -C Clear Memory,
    • -d N clears nth command
    • N Show recent n history
    • -a append this session to the new executed command to the history file
    • -R history file appended to the history list, is cumulative,
    • -W Saves the history list to the specified history file
    • -N History file unread lines are read into the history list
    • -P cmd Memory is not remembered, followed by a single quote command to execute
    • -S CMD can do fake
The $ environment variable for command history

histsize: number of records in the command history
histfile: Specify History file, default is ~/.bash_history
histfilesize: The number of times the command history file records history histtimeformat= "%F%T" display time
*histignore= "str1:str2:" * * Ignore str1 command, str2 the history of the beginning
Control how the Command history is recorded:

Environment variable: Histcontrol
ignoredups default, ignore duplicate commands, continuous and same as "repeat"
Ignorespace ignores all commands that start with a blank
Ignoreboth equivalent to Ignoredups, Ignorespace's combination
Erasedups Delete duplicate commands
Export variable name = "Value"
Store in/etc/profile or ~/.bash_profile

Learning Journey to Linux

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.