您的位置:首页 > 运维架构 > Linux

linux命令行常见约定

2015-12-21 17:10 519 查看
命令行风格

原始unix风格

命令行选项以连字符'-'开头的单个字符。

后面不带参数的模式标志可以组合在一起。

-a -b or -ab

偏爱小写字母,大写字母另有含义。

以简练为美.

GNU风格

两个连字符开头后接关键字。

如果有选项,空白和'='都可以作为分割。

--sort=size or --sort size

容易记忆,但是麻烦。

X toolkit风格

略过。

大多数程序是unix风格和gnu风格混用。

ls -l --sort size

1 a-z 命令行默认约定

随着时间的推移,一些字母的含义已经成为一种默认的

约定,遵循最小立异性原则,应该掌握这种常识。

-a

all(ls -a)

append

-b

set buffer/block size (du)

-d

debug

directory(ls -d)

delete

diffrent

-D

define(gcc -Dmac)

-e

execute(sed -e 'command' -e 'command1')

exclude

expression

-f

file(grep -f file)

force(rm -rf)

-h

header(ps)

-i

initialize

ineractive(rm -i)

-I

include(gcc -Ipath)

-k

keep(passwd, bzip, fetchmail)

kill

-l

list(ls -l)

load(gcc -llib)

-m

message(git commit -m)

-n

number(head -n 1)

-o

output(wget)

-p

port(ssh)

protocol(fetchmail)

-q

quite(make)

-r(R)

recurse(cp)

reverse(sort)

-s

slient(fetmail)

subject(mail, mutt)

size

-t

tag(vi)

-u

user(ps, fetchmail)

-v

verbose(tar, cp, cat)

version(patch)

-V

version(gcc, hostname)

-w

width(od)

warning(flex)

-x

启用调试 -d

-y

yes(yum update -y)

-z

启用压缩(bzip, tar)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: