Skip to content

Instantly share code, notes, and snippets.

@bennidi
Created February 24, 2022 08:40
Show Gist options
  • Save bennidi/5db3455fb0e05a4669204a3c09a630ed to your computer and use it in GitHub Desktop.
Save bennidi/5db3455fb0e05a4669204a3c09a630ed to your computer and use it in GitHub Desktop.
Awesome Fish|Bash

SOurce: https://www.gulshansingh.com/posts/useful-bash-aliases/

# ls aliases
alias ls='ls --color'
alias ll='ls -lh --color'
alias la='ls -lA --color'

# safe file management
alias cp='cp -iv'
alias rm='rm -i'
alias mv='mv -i'

# quick directory movement
alias ..='cd ..'
alias ...='cd ../..'
alias .3='cd ../../..'
alias .4='cd ../../../..'

# go to the last directory you were in
alias back='cd $OLDPWD'

# display numbers in a human readable format
alias df='df -h'
alias du='du -h'
alias free='free -h'

# copy the current working directory to the clipboard
alias cpwd='pwd | xclip -selection clipboard'

# quickly find files and directory
alias ff='find . -type f -name'
alias fd='find . -type d -name'

# get external ip
alias extip='curl icanhazip.com'

# quickly source the .bashrc file
alias srcbash='. ~/.bashrc'

# change the current directory to the parent directory that contains the .git folder
alias git-root='cd "`git rev-parse --show-toplevel`"'

# print the current time
alias now='date +%T'

https://www.digitalocean.com/community/questions/what-are-your-favorite-bash-aliases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment