What are your favorite bash aliases?
I use a lot of bash aliases on a daily basis! I love the fact that you can bundle commands and acti...
For further actions, you may consider blocking this person and/or reporting abuse
I use Ubuntu -- I have a
~/scripts
directory, where I put useful scripts. I then alias these for quick use.Here's a shortcut to open any VSCode workspace saved in
~/workspace/vscode-workspaces/
In
~/.bashrc
:I also have a git-versioned folder for notes in markdown. I like to create a file for daily notes, so I have
note
alias and script to create/open that file:In
~/.bashrc
:That's definitely something I should do! Such great ideas, thank you for these!
This one is my favorite. I use conda environments and switch between them many times per day. It pipes a list of available environments into fzf, trims out just the name then runs source activate on it.
Some generic aliases I use often
For updating xrdb resource definitions quickly
For navigating to common directories
For quickly editing configs I touch frequently
Those are different than mine, but definitely have the same idea! I haven't posted them here, but I have a lot of "cd" like aliases and "edit file" commands in there as well! Very useful aliases, nice!
Not too many, as I move around between systems quite a lot. The couple I can't do without are:
And to help with finding large directories/files:
100% adding those to my list!!
I use
git-amn
a lot to reword the last commit or append some hunksMy favourite function which I use a few times a year to study codebases for fun and profit 😉
I'm adding that amend alias to my list too, that's great! That method is really cool and takes care of so much manual work! Productivity 😅
Good topic Roelof!
I've got some similar ones, with one minor difference:
This makes it so that my
.bashrc
is sourced right after I finish editing it!I've also got a few convenience functions for common operations:
And some conda specific ones:
Oh I'm definitely adding those first three! They cover about 99% of my manual actions automatically, great aliases!
The tab completion I'm not familiar with, but that does look like some amazing productivity hacks!
alias
? I use bash files to run commands like alias.Example:
~/bin/
(eg:hello
file)sudo chmod +x hello
hello
hello
(likealias
)And these're my fav:
github
upload
That's a good idea as well! Perhaps a cleaner solution as well. I like aliases because I can add them to my setup bash script for new systems, append them to the .bashrc, source it and I'm good to go! I'll definitely look into your solution though, because that sounds very clean and allows for much more complex workflows as well.
I have replaced a few of my aliases with forgit. a package of several really good fuzzy git commands.
ga -> git add
That's a cool solution! I've seen many people use the ga command as well and always assumed it was manually done through aliases. This takes the manual work out of it, very exciting!
I actually had a set of fzf commands that I had made personally that this replaces as it is way more engineered and robust than what I came up with.
Your idea for alias sharing is great! Thank you all of you!
I personally use:
Made this repo,few months ago.
github.com/gathuku/bash_alias
Wow that is amazing! So clean and well documented, great job!
Thanks
doas=sudo
I've got
to launch my Angular local dev server. 😄
Short but sweet, I love it!
Nice shirt ones! Probably helps a lot with your productivity as well!