Linux基础:00_Linxu命令基础
1.Linux命令的组成部分
- 命令字
- 命令选项参数(简称“选项”)
- 命令操作参数(简称“参数”)
2.命令行格式
- 用户 command 【option】 【arguments】 回车
- $/# 命令名(命令程序名) 命令选项(说明对命令的要求) 命令参数(描述命令的作用) 命令提交
- 主语 谓语(动作) 状语(程度) 宾语(对象)
3.命令帮助
- 使用命令man阅读帮组手册页:manual手册页的缩写,man ls(查看ls命令的帮组信息),帮组手册页以man db的形式在系统中进行安装。手册页共8章。
- 使用命令的“--help”选项:很多命令可以使用--help来获取快捷帮组信息,展示的是选项使用信息。
- 使用info命令来血毒帮组信息页,与man相似,内容更加官方(详细)。
- 使用help命令来查看系统内部命令的帮组信息:内部命令(系统程序内部的子命令,称为内部命令或内建命令(build in),区别于外部命令(独立于第三方)。pwd(当前目录位置命令,是一个内部命令);ls就是外部命令。
4.常用命令
- ls
1 LS(1) User Commands LS(1) 2 3 NAME 4 ls - list directory contents 5 6 SYNOPSIS 7 ls [OPTION]... [FILE]... 8 9 DESCRIPTION 10 List information about the FILEs (the current directory by default). 11 Sort entries alphabetically if none of -cftuvSUX nor --sort is speci‐ 12 fied. 13 14 Mandatory arguments to long options are mandatory for short options 15 too. 16 17 -a, --all 18 do not ignore entries starting with . 19 20 -A, --almost-all 21 do not list implied . and ..
- pwd
1 PWD(1) User Commands PWD(1) 2 3 NAME 4 pwd - print name of current/working directory/打印出当前工作路径中所有完整文件名 5 6 SYNOPSIS 7 pwd [OPTION]... 8 9 DESCRIPTION 10 Print the full filename of the current working directory. 11 12 -L, --logical 13 use PWD from environment, even if it contains symlinks 14 15 -P, --physical 16 avoid all symlinks 17 18 --help display this help and exit 19 20 --version 21 output version information and exit/
- type:查询命令是否为内部命令或外部命令
1 zc@zc-dell:~$ type pwd 2 pwd 是 shell 内建
1 zc@zc-dell:~$ type ls 2 ls 是 `ls --color=auto' 的别名
- ls --help
1 zc@zc-dell:~$ ls --help 2 用法:ls [选项]... [文件]... 3 List information about the FILEs (the current directory by default). 4 Sort entries alphabetically if none of -cftuvSUX nor --sort is specified. 5 6 必选参数对长短选项同时适用。 7 -a, --all 不隐藏任何以. 开始的项目 8 -A, --almost-all 列出除. 及.. 以外的任何项目 9 --author 与-l 同时使用时列出每个文件的作者 10 -b, --escape 以八进制溢出序列表示不可打印的字符
浙公网安备 33010602011771号