Extra Unix Shell Material: Glossary

Key Points

Manual Pages
  • man command displays the manual page for a given command.

  • [OPTION]... means the given command can be followed by one or more optional flags.

  • Flags specified after ellipsis are still optional but must come after all other flags.

  • While inside the manual page,use / followed by your pattern to do interactive searching.

Working Remotely
  • SSH is a secure alternative to username/password authorization

  • SSH keys are generated in public/private pairs. Your public key can be shared with others. The private keys stays on your machine only.

  • The ‘ssh’ and ‘scp’ utilities are secure alternatives to logging into, and copying files to/from remote machine

Transferring Files
  • wget is the default tool, available in most Linux, to download file.

  • curl is another tools to download file which support larger protocols.

  • lftp is sosphisticated file transfer program with more capability including torrent support.

Permissions
  • Correct permissions are critical for the security of a system.

  • File permissions describe who and what can read, write, modify, and access a file.

  • Use ls -l to view the permissions for a specific file.

  • Use chmod to change permissions on a file or directory.

Job Control
  • When we talk of ‘job control’, we really mean ‘process control’

  • A running process can be stopped, paused, and/or made to run in the background

  • A process can be started so as to immediately run in the background

  • Paused or backgrounded processes can be brought back into the foreground

  • Process information can be inspected with ps

Aliases and Bash Customization
  • Aliases are used to create shortcuts or abbreviations

  • The .bashrc and .bash_profile files allow us to customize our bash environment.

  • The PS1 system variable can be changed to customize your bash prompt.

Shell Variables
  • Shell variables are by default treated as strings

  • The PATH variable defines the shell’s search path

  • Variables are assigned using “=” and recalled using the variable’s name prefixed by “$

Command Substitution
  • Command substitution can achieved by using dollar mark, $(things to be replaced).

  • Things to be replaced can be words and outputs of another command

  • Command substitution can be used for inputs and output of another command, but the output side must be modified to avoid file replacements.

AWK
  • awk can be used to manipulate and filter data, e.g. adding text or printing specific columns

  • NF is a variable that stores the number of fields in the current line

  • Field separator can be specified with the -F option, default is space

  • Matching patterns can be specified with /^PATTERN/ instruction

Glossary

remote login
FIXME
remote login server
FIXME
SSH daemon
FIXME
secure shell
FIXME
SSH key
FIXME
SSH protocol
FIXME
command
FIXME
user name
FIXME
user ID
FIXME
user group
FIXME
user group name
FIXME
user group ID
FIXME
access control lists
FIXME
search path
FIXME