• 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 了。

  • 相关阅读:
    #Leetcode# 204. Count Primes
    #Leetcode# 202. Happy Number
    #Leetcode# 8. String to Integer (atoi)
    VMWare(虚拟机) 网络配置模式 :桥接模式、nat模式、主机模式
    领域的建立
    需求获取的前期工作(不断更新)
    2.4文件查找与文件列表
    2.3录制并回放终端会话
    2命令之乐,2.1简介
    1.7比较与测试
  • 原文地址:https://www.cnblogs.com/zdwu/p/6801270.html
Copyright © 2020-2023  润新知