DEV Community

ablil
ablil

Posted on

My best shell (bash) aliases on Linux (Fedora) !

If you are using the shell daily and haven't defined some aliases yet, you are doing it wrong.

Here is a list of my favorites aliases that I configure on every new machine.

Basic aliases

alias l="ls"
alias v="vim"
alias s="sudo"

alias cpr="cp -rv"
alias rmr="rm -r"
alias rmf="rm -f"
alias mkdir="mkdir -p -v"
Enter fullscreen mode Exit fullscreen mode

Display json in pretty format (on terminal)

alias pretty="python3 -mjson.tool"
Enter fullscreen mode Exit fullscreen mode

Send post request (json)

alias cpost="curl -X POST -H 'Content-Type: application/json'"
Enter fullscreen mode Exit fullscreen mode

find file or directory in current directory

alias ffind="find . -type f"
alias dfind="find . -type d"
Enter fullscreen mode Exit fullscreen mode

*Update all packates and remove unecessary (Fedora) *

alias sysupdate="sudo dnf -y update && sudo dnf -y autoremove && sudo dnf -y remove --oldinstallonly"
Enter fullscreen mode Exit fullscreen mode

Get my public ip

alias myip="curl ifconfig.me"
Enter fullscreen mode Exit fullscreen mode

Check internet connection

alias conn="ping -c 2 google.com"
Enter fullscreen mode Exit fullscreen mode

What are you favorites bash aliases ???

Top comments (0)