Linux/Unix 指令使用说明的格式介绍(the Bash Command 'Usage' Syntax)

Linux/Unix 指令使用说明的格式介绍(the Bash Command 'Usage' Syntax

摘自    金马的Blog

原文  http://www.lijinma.com/blog/2014/08/24/bash-command-usage-syntax/

此片文章是对自己的一个提醒!

很多时候在 Linux/Unix 平台上看到一个命令的 Usage 的时候,以为看懂了,其实根本没看懂,还需要通过 man 来查阅,今天我就讲讲 Usage 的语法(syntax)。

bold text          type exactly as shown.

italic text        replace with appropriate argument.

[-abc]             any or all arguments within [ ] are optional.

-a|-b              options delimited by | cannot be used together.argument ...       argument is repeatable.

[expression] ...   entire expression within [ ] is repeatable.

举例

$ cp usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file

       cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory

其中 cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory 包括6部分:

cp 是指令名称。

[-R [-H | -L | -P]] 一个 options 块, -H  -L  -P 三个选项互斥。

[-fi | -n] 一个 options 块, -fi  -n 选项互斥

[-apvX] 一个 options 块,

所有在[]内的参数可以不选择使用,也可以全部选择使用。

source_file ... 文件名, ... 表示可以有多个文件,就是可以有多个 source_file

target_directory 一个参数,表示要复制文件的最终文件夹。

实例:

$ cp file1 file2 file3 directory

$ ls direcoty

file1 file2 file3

妈妈再也不用担心我不懂 Command usage 了。

 

转载于:https://www.cnblogs.com/zdwu/p/6801270.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值