Hdi2u S01

From wiki
Revision as of 22:25, 19 April 2017 by Rf (talk | contribs)
Jump to: navigation, search

The Command-line (shell)

The real power of Linux/Unix systems is the command line.

  • Many programs and facilities are available through graphical options on Linux, but all programs and facilities can be accessed by the command line, also known as the shell.
  • Graphical interfaces are good for reduced data, when analysing processed data.
  • web services and curses-mode screens are halfway between command-line and grapihical interface.
  • However for "heavy-lifting", the command-line is much more convenient
  • Obvious examples include when you need to work with large numbers of files or want to automate processes.
  • It's common to talk about "fear of the commandline", our aim is to reduce this.

Anatomy of a Command

<command> <options/parameters> <arguments>
  • <command> what do I want to do?
  • <options/parameters> how do I want to do it?
  • <arguments>, on what do I want to do it?
  • first word you supply on the command line is interpreted by the system as a command, an operation.
  • Items that appear after that on on the same line are separated by spaces.
  • Most commands have options available that will alter the way the command functions.
  • after the options we have what are called arguments, often these are input files.
  • With some commands you don't need to issue any parameters or arguments. This is because you are using the default settings.
  • To know the default settings the documentation must be read.
  • If a command runs successfully, it often will not report anything back to you
  • You can of course tell by the nature of the putput files it produced.
  • If a command is unsuccessful, it will report an error. Most of the time, these are informative, even if a bit cryptic.
  • However, if you forgot to specify the input file, you should be able to interpret that.