Skip to content

Instantly share code, notes, and snippets.

@nassimhaddad
Last active December 19, 2015 10:19
Show Gist options
  • Save nassimhaddad/5939837 to your computer and use it in GitHub Desktop.
Save nassimhaddad/5939837 to your computer and use it in GitHub Desktop.

Base Commands

Command Description
wc word count
ls list directory contents
cd change directory
pwd returns present working directory
type tells whether a command is built-in or a program
rm remove
printenv returns all the shell's variables
echo print on screen
export make a variable available to other programs invoked by the shell -> it becomes an environment variable
PATH=$PATH:/usr/sbin add /usr/sbin to PATH variable
alias ll='ls -l' defines a shortcut
cut -d. -f2 extract file extension
sort sort
less pause output whenever the window fills up

Features of the bash shell

Command Description
ls a* * is a wildcard
MYVAR = 3 define a variable
echo $MYVAR returns content of a variable
$HOME/.bash_profile startup file
<, >, >> from, to (overwirte), to (append) file
pipe pipe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment