Create aliases in FreeBSD

To create aliases, create and edit the .bashrc file in the /root directory.
  1. # .bashrc
  2. # User specific aliases and functions
  3.  
  4. alias rm="rm -i"
  5. alias cp="cp -i"
  6. alias mv="mv -i"
  7. alias h="history 25"
  8. alias j="jobs -l"
  9. alias la="ls -a"
  10. alias lf="ls -FA"
  11. alias ll="ls -lA"
  12.  
  13. alias updatedb="/usr/libexec/locate.updatedb && echo '>>> Locate database updated successfully'"
  14. alias apache.start="/usr/local/sbin/apachectl -k start && echo 'Apache started'"
  15. alias apache.stop="/usr/local/sbin/apachectl -k stop && echo 'Apache stoped'"
  16. alias apache.restart="/usr/local/sbin/apachectl -k stop && sleep 3 && /usr/local/sbin/apachectl -k start && echo 'Apache restarted'"
  17.  
  18. # Source global definitions
  19. if [ -f /etc/bashrc ]; then
  20. . /etc/bashrc
  21. fi