Linux command: alias

From RHS Wiki
Revision as of 09:58, 8 April 2015 by Rafahsolis (talk | contribs)
Jump to navigation Jump to search

Create alias

alias imagenes='cd /media/discoduro/archivos/Pictures'

Create permanent alias

echo 'alias imagenes="cd /media/discoduro/archivos/Pictures"' >> ~/.bashrc && . ~/.bashrc

delete alias

unalias imagenes

see defined alias

alias

alias definition file

alias can also be defined in file ~/.bash_aliases.
Example ~/.bash_aliases

#!/bin/bash
alias instala="sudo apt-get install"
alias vpn=/home/rafa/vpn.sh
 

Some usefull alias

  • alias h="history" # quick access to command history
  • alias c="clear" # quick way to clear terminal screen
  • alias grep="grep —color -n" # colorize matches; show line numbers
  • alias df="df -h" # show free space using human readable units
  • alias du="du -sh" # show disk usage using human readable units
  • alias sc="source $HOME/.cshrc"
  • alias gousb="cd $USBDRIVE_PATH"