LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > lazydog
User Name
Password

Notices


Rating: 2 votes, 4.50 average.

My Aliases used on a daily basis

Posted 06-30-2016 at 01:57 PM by lazydog

Here is a list of Aliases I use on a daily basis, some more then others. For machines I do not have a home directory I carry a small usb stick that I then source them from.

For systems I have a home directory on I source them from bashrc as follows:

Code:
# Common Aliases
if [ -e ~/.alias ]; then
         source ~/.alias
fi
Alias List:
Code:
#######################################################
# GENERAL ALIAS'S
#######################################################
# To temporarily bypass an alias, we preceed the command with a \
# EG: the ls command is aliased, but to use the normal ls command you would type \ls

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
 alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# alias to show the date
 alias da='date "+%Y-%m-%d %A %T %Z"'

# Alias's to modified commands
 alias cls='clear'
 alias cp='cp -i'
 alias cpr='cp -rpv'
 alias df='df -kTh'
 alias df1='df -iTa'
 alias diff='diff -up'
 alias dsiz='du -sk * | sort -n --'
 alias du='du -kh'
 alias du1='echo *|tr " " "\n" |xargs -iFF du -hs FF|sort'
 alias env='env | sort'
 alias freshclam='sudo freshclam'
 alias idsystem='hostnamectl status'
 alias inice='ionice -c3 -n7 nice'
 alias j='jobs -l'
 alias less='less -R'
 alias mann='man -H'
 alias mkdir='mkdir -p'
 alias multitail='multitail --no-repeat -c'
 alias mv='mv -i'
 alias p='ps -HAcl -F S -A f|uniq -w3'
 alias path='echo -e ${PATH//:/\\n}'
 alias ping='ping -c 10'
 alias ps='ps auxf'
 alias rm='rm -iv'
 alias svi='sudo vi'
 alias syum='sudo yum install '
 alias vi='vim'
 alias vis='vim "+set si"'

# Change directory aliases
  alias home='cd ~'
  alias u='cd ..'
  alias uu='cd ../..'
  alias uuu='cd ../../..'
  alias uuuu='cd ../../../..'

# Change directory aliases
 alias home='cd ~'
 alias cd..='cd ..'
 alias ..='cd ..'
 alias ...='cd ../..'
 alias ....='cd ../../..'
 alias .....='cd ../../../..'

# Show file permissions
 alias perms="stat -c '%a - %n'"

# cd into the old directory
 alias bd='cd "$OLDPWD"'

# Remove a directory and all files
 alias rmd='/bin/rm  --recursive --force --verbose '

# Alias's for multiple directory listing commands
 alias l=less
 alias la='ls -Alh' # show hidden files
 alias labc='ls -lap' #alphabetical sort
 alias lc='ls -lcrh' # sort by change time
 alias ld="ls -l | egrep '^d'" # directories only
 alias lf="ls -l | egrep -v '^d'" # files only
 alias lk='ls -lSrh' # sort by size
 alias ll='ls -Fls' # long listing format
 alias lll='stat -c %a\ %N\ %G\ %U ${PWD}/*|sort'
 alias lm='ls -alh | less' # pipe through 'less'
 alias lr='ls -lRh | less' # recursive ls
 alias ls='ls -aFh --color=always' # add colors and file type extensions
 alias lt='ls -ltrh' # sort by date
 alias lu='ls -lurh' # sort by access time
 alias lw='ls -xAh' # wide listing format
 alias lx='ls -lXBh' # sort by extension

# Chmod commands
 alias chmod='chmod -c'
 alias mx='chmod a+x'
 alias 000='chmod -R 000'
 alias 644='chmod -R 644'
 alias 666='chmod -R 666'
 alias 755='chmod -R 755'
 alias 777='chmod -R 777'

# Search command line history
 alias h='history'
 alias hs="history | grep "

# Search running processes
 alias p="ps aux | grep "
 alias topcpu="/bin/ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10"

# Search files in the current folder
 alias f="find . | grep "

# Count all files (recursively) in the current folder
 alias countfiles="for t in files links directories; do echo \`find . -type \${t:0:1} | wc -l\` \$t; done 2> /dev/null"

# To see if a command is aliased, a file, or a built-in command
 alias chkcmd="type -t"

# Show current network connections to the server
 alias ipview="netstat -anpl | grep :80 | awk {'print \$5'} | cut -d\":\" -f1 | sort | uniq -c | sort -n | sed -e 's/^ *//' -e 's/ *\$//'"

# Show open ports
 alias openports='netstat -nape --inet'

# Alias's for safe and forced reboots
 alias rebootsafe='sudo shutdown -r now'
 alias rebootforce='sudo shutdown -r -n now'

# Alias's to show disk space and space used in a folder
 alias diskspace="du -S | sort -n -r |less"
 alias folders='du -h --max-depth=1'
 alias folderssort='find . -maxdepth 1 -type d -print0 | xargs -0 du -sk | sort -rn'
 alias tree='tree -CAhF --dirsfirst'
 alias treed='tree -CAFd'
 alias mountedinfo='df -hT'

# Alias's for archives
 alias mktar='tar -cvf'
 alias mkbz2='tar -cvjf'
 alias mkgz='tar -cvzf'
 alias untar='tar -xvf'
 alias unbz2='tar -xvjf'
 alias ungz='tar -xvzf'

# Show all logs in /var/log
 alias logs="sudo find /var/log -type f -exec file {} \; | grep 'text' | cut -d' ' -f1 | sed -e's/:$//g' | grep -v '[0-9]$' | xargs tail -f"

# SHA1
 alias sha1='openssl sha1'

# Mis aliases
 alias php='php -d report_memleaks=1 -d report_zend_debug=1 -d log_errors=0 -d ignore_repeated_errors=0 -d ignore_repeated_source=0 -d error_reporting=30719 -d display_startup_errors=1 -d display_errors=1'
 alias pp='ps -HAcl -F S -A f'
 alias ps1='ps -lFA'
 alias ps2='ps -H'
 alias resetw='echo $'\''\33[H\33[2J'\'''
 alias subash='sudo sh -c '\''export HOME=/root; cd /root; exec bash -l'\'''
 alias top='top -c'
 alias tree='tree -C'
 alias updatedb='( ( updatedb 2>/dev/null ) & )'
 #alias vim='vim --noplugin'
 alias who='who -ar -pld'
 alias wtf='watch -n 1 w -hs'
 alias x=exit
Posted in Uncategorized
Views 2896 Comments 1
« Prev     Main     Next »
Total Comments 1

Comments

  1. Old Comment
    Robert:
    See http://www.linuxquestions.org/questi...le-4175518169/ for some stuff you may find interesting.

    JJ
    Posted 06-30-2016 at 02:38 PM by Habitual Habitual is offline
 

  



All times are GMT -5. The time now is 06:19 PM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration