The path to the Shell program search executable file is defined in the PATH environment variable
[Email protected] ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/jdk1.7.0_75/bin:/usr/local/ Zookeeper-3.4.6/bin:/usr/local/hadoop-2.6.0/bin:/root/bin
Note: From left to right
See how commands are used by help command
[[email protected] ~]# Help CD
CD:CD [-l|-p] [dir]
Change the shell working directory.
Change the current directory to DIR. The default DIR is the value of the
HOME Shell variable.
The variable Cdpath defines the search path for the directory containing
DIR. Alternative directory names in Cdpath is separated by a colon (:).
A NULL directory name is the same as the current directory. If DIR begins
With a slash (/) and then Cdpath are not used.
If The directory is not a found, and the shell option ' cdable_vars ' is set,
The word is assumed to be a variable name. If the variable has a value,
Its value is used for DIR.
Options:
-L Force Symbolic links to be followed
-p Use the physical directory structure without following symbolic
Links
The default is to follow symbolic links, as if '-l ' were specified.
Exit Status:
Returns 0 If the directory is changed; Non-zero otherwise.
User manual (Manual) Man COMMAND
Mans LS
LS (1) User Commands ls (1)
NAME
Ls-list Directory Contents
Synopsis
ls [OPTION] ... [FILE] ...
DESCRIPTION
List information about the FILEs (the current directory by default). Sort entries
Alphabetically if none Of-cftuvsux nor--sort.
Mandatory arguments to long options is Mandatory for short options too.
-A,--all
Do not ignore entries starting with.
-A,--almost-all
Do not list implied. and..
--author
With-l, print the author of each file
-B,--escape
Print octal escapes for nongraphic characters
--block-size=size
Use Size-byte blocks. See SIZE format below
Info Page # Info COMMAND
Help documentation for the program itself
Readme
INSTALL
ChangeLog
Internal command assistance: # Help command
Hash command: The path result of the external command that the shell has searched for is cached into the KV (key-value) store;
[[email protected] ~]# hash
Hitscommand
1/bin/grep
3/bin/cat
1/bin/ls
-
History command
Manage command history, when you log in to the shell, the commands that are recorded in the command history file are read: ~/.bash_history
History
-A: Append the newly executed command history list to the history file in this session
-D: Delete the command specified in history
-C: Empty command history
[email protected] ~]# cat. bash_history
chmod u-w/etc/sudoers
sudo ifconfig
Shutdown-h now
Ifconfig
Ping www.baidu.com
Shutdown-h now
Ifconfig
Service Network restart
Ping www.baidu.com
Shutdown-h now
Linux Quick Action
!#: Call history in the # command
For example, through the history view is as follows:
1022 pwd
1023 Cat. Bash_history
1024x768 Clear
1025 History
[Email protected] ~]#!1022
Pwd
/root
!string: Call the last command in history that starts with a string (and then complements it)
!: Previous command (back up)
External commands help get
Mans COMMAND
Manual page:/usr/share/man
[Email protected] ~]# ls/usr/share/man/
BG de es hr it man0p man1x man3 man4 man5x man7 man8x Mann PL RO SL ZH_CN cs el fi hu ja Man1 man2 man3p man4x man6 man7x man9 nl pt RU SV ZH_TW
Da en fr id ko man1p man2x man3x man5 man6x man8 Man9x overrides Pt_br SK TR
Note: Man1. MAN8 main functions are as follows:
Man1: User Commands
Man2: System call
MAN3:C Library Call
MAN4: Equipment files and special files
MAN5: Configuration file format
Man6: Games
MAN7: Miscellaneous
MAN8: Commands for managing classes
[Email protected] ~]# LS/USR/SHARE/MAN/MAN8
abrtd.8.gz iptunnel.8.gz qmqpd.8.gz
abrt-dbus.8.gz isosize.8.gz quotacheck.8.gz
accept.8.gz iw.8.gz quota_nld.8.gz
accton.8.gz iwconfig.8.gz quotaoff.8.gz
acpid.8.gz iwevent.8.gz quotaon.8.gz
acpi_listen.8.gz iwgetid.8.gz quotastats.8.gz
addgnupghome.8.gz iwlist.8.gz raw.8.gz
addpart.8.gz iwpriv.8.gz rawdevices.8.gz
adduser.8.gz iwspy.8.gz rdisc.8.gz
agetty.8.gz kbdrate.8.gz reboot.8.gz
alternatives.8.gz kexec.8.gz regdbdump.8.gz
anacron.8.gz killall5.8.gz reject.8.gz
anvil.8.gz killpgrp.8.gz reload.8.gz
View the LS command in which document (compressed package) LS command in man1 this path
[Email protected] ~]# Ls/usr/share/man/man1 | grep ls.*
Alsactl.1.gz
Alsaloop.1.gz
Alsamixer.1.gz
False.1.gz
Ls.1.gz
Lsattr.1.gz
Lscpu.1.gz
Lshal.1.gz
Lsinitrd.1.gz
Lslogins.1.gz
Mtools.1.gz
Mtoolstest.1.gz
Perlsec.1.gz
Perlsolaris.1.gz
Perlstyle.1.gz
Perlsub.1.gz
Perlsymbian.1.gz
Perlsyn.1.gz
Pulseaudio.1.gz
Xlsatoms.1.gz
Xlsclients.1.gz
Xlsfonts.1.gz
Yum-utils.1.gz
Text Search
/keyword:
Searches the end of the file from the current position with the string specified by keyword as the keyword;
Search slave keywords
[Email protected] ~]# vim/etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
:: 1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.107 Master
192.168.1.108 Slave
~
~
~
~
:/slave
N: Next
N: Previous
? KEYWORD:
The string specified by keyword is the keyword, and the file header is searched from the current position;
N: Same direction as search command, next
N: Follow the search command in the opposite direction, previous
The configuration file path for the man command/etc/man.config
[Email protected] ~]# More/etc/man.config
# Manbin/usr/local/bin/man
#
# Every automatically generated MANPATH includes these fields
#
MANPATH/usr/man
MANPATH/usr/share/man
MANPATH/usr/local/man
MANPATH/usr/local/share/man
MANPATH/usr/x11r6/man
#
# Uncomment if want to include one of the These by default
#
# MANPATH/opt/*/man
# MANPATH/usr/lib/*/man
# MANPATH/usr/share/*/man
# MANPATH/usr/kerberos/man
#
# Set up PATH to MANPATH mapping
Manpath/path/to/somewhere: Indicates the new manual file search location
# man-m/path/to/somewhere Command: Searches the command command's hand album to the specified location and displays it;
The paragraph description in the Help manual:
NAME
Synopsis
DESCRIPTION
OPTIONS
EXAMPLES
AUTHOR
REPORTING BUGS
See ALSO
Synopsis:
This article is from the "Liang blog" blog, make sure to keep this source http://7038006.blog.51cto.com/7028006/1793777