Helpful user-created aliases

C

CrazedNerd

Guest
Do any of you care much for making aliases? Making an alias is very similar to making a script, however, you don't need to have a separate file for each one. Most of mine center around the ls command, which is arguably the most useful command in linux. Here is my .bash_aliases file:

Code:
#'=' must not be surrounded by whitespace for these to work"
alias ls='ls -1v --color=auto -hAF'
#-1v sorts numbered files lowest-highest, h shows hidden, A conceals"
#. and .., -F color codes file types"
#aliases below do not work without this

#hidden files
alias lsh='ls -d .* | grep -v /'

#files (no directory)"
alias lsf='ls | grep -v /'

#only directories, hidden included"
alias lsd='ls -d */ .*/'


#only hidden directories
alias lsdh='ls -d .* | grep -v *.txt'

#displays most recently modified files at top
alias lst='ls -t'

alias grep='grep -i'

#automatically ignores case

alias nano='nano -c'

#show cursor, column (by char), line stats at bottom of page in nano

alias lexe='ls | grep "*"'

#shows files with execute permissions enabled for scripts etc.

alias lsl='ls -l'

#highly detailed ls

alias work='. .bash_aliases; . .bashrc'

#make changes to bash effective immediately
 


I use aliases all the time. Here's a fun one:

Code:
alias picclean="exiftool -overwrite_original -all= *.png ; exiftool -overwrite_original -all= *.jpg ; echo $PWD 'images cleaned for privacy sake!'"
 

Members online


Top