Aliases can be very helpful for any linux user, and after writing my last post “How to create custom command in Unix/Linux” I want to share these helpful bash aliases for any unix/linux user.
List in long format
alias ll=’ls -l’
Clear the screen
alias c=’clear’
Clear the history and screen
alias hcl=’history -c; clear’
use Bye to exit
alias bye=’exit’
Some change directory options
alias ..=’cd ..’
alias …=’cd ../..’
alias ….=’cd ../../..’
alias …..=’cd ../../../..’
Display path info
alias path=’echo -e ${PATH//:/\n}’
Display current Date/Time or Both
alias now=’date’
alias nowtime=’date +”%T”‘
alias nowdate=’date +”%d-%m-%Y”‘
Open last modified file in VIM
alias Vim=”vim ‘ls -t | head -1′”
Show all running java processes
alias psjava=’ps -ef | grep java’
If you are a regular windows user, create windows version of linux commands
alias cls=’clear’
alias dir=’ls -l’
alias chdir=’cd’
alias md=’mkdir’
alias copy=’cp’
alias rename=’mv’
alias move=’mv’
alias del=’rm -i’
alias rd=’rmdir’
alias deltree=’rm -r’
I think these alias can be helpful for you. There are many more but I’ve shared those I think are very useful for any Unix/Linux user.
References: