Unix Command Basic

Command Fundamentals

  1. general form : command options arguments
    1. option: change the manner of operation of a command
      1. start  with – or —
    2. argument: object of command
  2. command is a build program / built-in operation

Help with command

  1. man command
  2. apropos
  3. whatis
  4. info command
  5. khelpcenter

Program Execution Environment

  • HOME:your home directory
  • PATH: directories that are automatically searched
    • control where to look for commands
  • TERM your output (display) device
  • more…
  • env / printenv / set : print all environment variable
  • export EnvVar=Value (change value of environment variable)(persist)

 

Useful Directories

  • /bin                      “minimal set” commands
  • /usr/bin               most user commands
  • /usr/local/bin    local versions of commands

 

Locate a command

  • which/ whereis

 

History Buffer: record of the last command

  • history command: print 1000 command used before
  • !!: repeat the last command used
  • !number: repeat last number
  • !string: repeat last string

Command/Filename Completion

  • character + TAB to get all possibility of completion of the command
  • ^X/ possible file name
  • ^X! possible command
  • use FIGNORE shell variable to check additionally function

Variable SHELLOPTS shows a list of enabled shell options

Control terminal setting by stty command

Set shortcut of command: alias Var  =”command”

  • see all alias by alias
  • remove by unalias

 

 

 

 

留下评论