官术网_书友最值得收藏!

Simple commands

At an interactive Bash prompt, you can enter a command line for Bash to execute. Most often while in interactive mode, you would issue only one simple command at a time, ending each command with Enter. You would then wait for each command to finish before entering the next one, examining any output or errors that it passes to your terminal after each command.

A simple command consists of at least a command name, possibly with one or more arguments, each separated by at least one space. The full definition can also include environment variable assignments and redirection operators, which we'll explore in later chapters.

Let's consider the following command:

$ mkdir -p New/bash

This simple command consists of three shell words:

  • mkdir: The command name, referring to the mkdir program that creates a directory
  • -p: An option string for mkdir that specifies that the full directory path can be created, whether or not any of the directories in the path already exist
  • New/bash: The relative path for the directory to create

Note that -p is not a special word or syntax to Bash; it's special to mkdir. Bash simply passes it to mkdir as an argument. The meaning of command options is a property of the commands themselves, not the shell from which they're called.

主站蜘蛛池模板: 沈阳市| 黄冈市| 鲜城| 潮安县| 社旗县| 樟树市| 唐海县| 克拉玛依市| 临海市| 卢龙县| 佳木斯市| 县级市| 棋牌| 大丰市| 南江县| 西乡县| 和平县| 黔西县| 牙克石市| 雷山县| 策勒县| 南丰县| 嘉兴市| 郸城县| 兰州市| 晋宁县| 浦江县| 嘉定区| 浮梁县| 上饶县| 巴林右旗| 芮城县| 五原县| 方正县| 焦作市| 茌平县| 望江县| 德格县| 平舆县| 五大连池市| 临夏市|