Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Mayank's Final Alias. Mayank@ IITGuwahati. Thankyou various websites, google, forums, posts :)
- #Default editor is Sublime with executable subl . you can change that !
- #alias cp="cp -i" # confirm before overwriting something
- #alias grep='grep --color=tty -d skip'
- #alias in='yaourt --noconfirm'
- #alias l='ls -lBohc'
- #alias rs='rsync -avz --progress --fuzzy -e "ssh"'
- #alias text='gedit &'
- alias ....='cd ../../../../'
- alias ...='cd ../../../'
- alias ..='cd ..'
- alias .4='cd ../../../../'
- alias .5='cd ../../../../..'
- alias a='echo "------------Your aliases------------";alias'
- alias c='cd /run/media/u/'
- alias cd..='cd ..'
- alias cdd='cd ~/Desktop'
- alias cddoc='cd ~/Documents'
- alias cddown='cd ~/Downloads'
- alias cdm='cd ~/Music'
- alias cdv='cd ~/Videos'
- alias chr='chmod 644'
- alias chx='chmod 755'
- alias c=clear
- alias d='python2.7 /usr/local/bin/d.py &'
- alias df="df -Th --total"
- alias du="du -ach | sort -h"
- alias e='exit'
- alias egrep='egrep --color=auto'
- alias explore='nautilus .'
- alias fgrep='fgrep --color=auto'
- alias fhere="find . -name "
- alias free="free -mt"
- alias freemem='sync && echo 3 | sudo tee /proc/sys/vm/drop_caches'
- alias g='git'
- alias go=gnome-open
- alias grep='grep --color=auto'
- alias h='history'
- alias historyc='history | cut -c 8-'
- alias hs='history | grep -i $1'
- alias i='sudo apt-get install '
- alias init0='sudo shutdown –h now' #requires root password, disable it by "sudo chmod u+s /sbin/shutdown"
- alias iy='sudo apt-get install -y'
- alias k='killall chrome firefox thunderbird -q'
- alias l='ls --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
- alias la='ls -lah --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
- alias ldir='ls -l | grep ^d'
- alias ll='ls -lh --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
- alias lla='ll -A' # hidden
- alias lock='gnome-screensaver-command --lock'
- alias ls='ls --group-directories-first --time-style=+"%d.%m.%Y %H:%M" --color=auto -F'
- alias lsl="ls -lhFA | less"
- alias mkdir="mkdir -pv"
- alias mount='mount |column -t'
- alias pdfcrop='pdfcrop --margins "2 2 2 2" '
- alias ps="ps auxf"
- alias psg='ps aux | grep -i $1'
- alias q='exit'
- alias reboot='sudo reboot' #requires root password, disable it by "sudo chmod u+s /sbin/shutdown"
- alias restart='sudo poweroff' #requires root password, disable it by "sudo chmod u+s /sbin/shutdown"
- alias r='sudo reboot' #requires root password, disable it by "sudo chmod u+s /sbin/shutdown"
- alias rmf='rm -rf'
- alias rsd='rsync -avz --progress --delete-after --fuzzy -e "ssh"'
- alias s='subl'
- alias sa='source ~/.bashrc;echo "Bash aliases sourced."'
- alias se='apt-cache search '
- alias search='apt-cache search '
- alias shutdown='sudo shutdown –h now' #requires root password, disable it by "sudo chmod u+s /sbin/shutdown"
- alias sl="ls"
- alias so='source ~/.bashrc'
- alias suexplore='sudo nautilus .'
- alias suspend='sudo pm-suspend'
- alias sutext='gksudo gedit &'
- alias svim='sudo vim'
- alias text='subl &'
- alias tgz='tar -zxvf'
- alias top="htop"
- alias topf='find . -type f -print0 | xargs -0 du -h | sort -hr | head -n 100'
- alias try='gnome-open'
- alias unrar='rar e'
- alias up='sudo apt-get update'
- alias update='sudo apt-get update'
- alias wget="wget -c"
- alias x='localc'
- alias z='sudo ' # the space allows for command name expansion.
- #Let's start off by demonstrating an extremely useful bash function. This one will create a directory and then immediately move into that directory. This is usually exactly the sequence we take when making new directories:
- mcd () {
- mkdir -p $1
- cd $1
- }
- function ex {
- if [ -z "$1" ]; then
- # display usage if no parameters given
- echo "Usage: extract <path/file_name>.<zip|rar|bz2|gz|tar|tbz2|tgz|Z|7z|xz|ex|tar.bz2|tar.gz|tar.xz>"
- else
- if [ -f $1 ] ; then
- # NAME=${1%.*}
- # mkdir $NAME && cd $NAME
- case $1 in
- *.tar.bz2) tar xvjf $1 ;;
- *.tar.gz) tar xvzf $1 ;;
- *.tar.xz) tar xvJf $1 ;;
- *.lzma) unlzma $1 ;;
- *.bz2) bunzip2 $1 ;;
- *.rar) unrar x -ad $1 ;;
- *.gz) gunzip $1 ;;
- *.tar) tar xvf $1 ;;
- *.tbz2) tar xvjf $1 ;;
- *.tgz) tar xvzf $1 ;;
- *.zip) unzip $1 ;;
- *.Z) uncompress $1 ;;
- *.7z) 7z x $1 ;;
- *.xz) unxz $1 ;;
- *.exe) cabextract $1 ;;
- *) echo "extract: '$1' - unknown archive method" ;;
- esac
- else
- echo "$1 - file does not exist"
- fi
- fi
- }
- myinfo () {
- printf "CPU: "
- cat /proc/cpuinfo | grep "model name" | head -1 | awk '{ for (i = 4; i <= NF; i++) printf "%s ", $i }'
- printf "\n"
- cat /etc/issue | awk '{ printf "OS: %s %s %s %s | " , $1 , $2 , $3 , $4 }'
- uname -a | awk '{ printf "Kernel: %s " , $3 }'
- uname -m | awk '{ printf "%s | " , $1 }'
- if ! type "kded4" > /dev/null; then
- echo -n ""
- else
- kded4 --version | grep "KDE Development Platform" | awk '{ printf "KDE: %s", $4 }'
- fi
- printf "\n"
- uptime | awk '{ printf "Uptime: %s %s %s", $3, $4, $5 }' | sed 's/,//g'
- printf "\n"
- cputemp | head -1 | awk '{ printf "%s %s %s\n", $1, $2, $3 }'
- cputemp | tail -1 | awk '{ printf "%s %s %s\n", $1, $2, $3 }'
- #cputemp | awk '{ printf "%s %s", $1 $2 }'
- }
- #Use it as dp N, where N is 1, 2 or 3.
- dp () {
- if [[ $1 -eq "1" || $# -eq "0" ]]; then
- PS1="\033[01;32m$\033[00m "
- elif [[ $1 -eq "2" ]]; then
- PS1="${debian_chroot:+($debian_chroot)}\w\033[01;32m$\033[00m "
- elif [[ $1 -eq "3" ]]; then
- PS1="\033[01;32m\u@\H:${debian_chroot:+($debian_chroot)}\w\033[01;32m$\033[00m "
- fi
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement