Some people might want to consider typo correction aliases too, like "apt serach='apt search', gerp=grep" etc. Possibly with a "assuming you meant grep instead of gerp, continuing in 3,2,1.." wrapper for safety.
Just 'doomed scrolled' on to your video......excellent info here, great video. I don't usually bother with too many alias settings etc as I'm swapping between machines so much (and when they're not there you've forgotten the long way of doing it ;) However, some really good stuff here and I'm learned a few extra tricks from your video. Not sure about no 9..... s for redo last command with sudo? you didn't show how, so I guess you're writing a function or similar. Anyway, I do that with the lifesaver short cut sudo !! !! re runs the last command in history, so sudo !! runs last command in history with sudo :)
I factor most of my .bashrc into separate files. I ended up with the extension .stuff. I put them either in /usr/jda/stuff (systemwide) or ~/bin/my_stuff.d (user). Some are autoloaded, some are not. I use commands starting with . for things like this. So .s will load a .stuff file (e.g. ".s cd" will load all my customisations related to directories).
That's a cool idea. I already outsourced my aliases and my bash-prompt. But it's even smarter to source stuff like longer functions just when they are needed. On the other hand with today's amount of memory and cpu available I doubt you would notice a difference in speed when you open up a new user-shell. Me personally I hate long, cluttered config files and I always want to have a clear and nice to look at bashrc with a bit more comrehensible commenting.
@@audiolatroushearetic1822 It's only a few things like setting up anaconda that I want on demand, rather than by default. So to initialise anaconda, I type .s conda. There are a few other things I don't always want. It's slower the way I do it, but acceptable.
@@Tech-Guides Your 'c' is an alias to 'clear', whereas ^L that @jamesbond_007 is referring to is an alias to 'clear -x' in which you can still scroll up to see the ouptut. Check 'man clear' ;)
Very nice video with useful content and well explained as well. Please, let me also add a feedback more than a critic. I didn't appreciated very much the music in the background when you talk, it's not very loud but to my taste it's a little bit disturbing. Maybe it's just me. Anyway, very good piece of content. Thanks.
I am not sufficiently lazy to use some of these aliases (like for sudo !!) but some of this definitely is handy, I am going to copypaste it. I like the alias to use rsync instead of cp for when you copy large files (like moving videos to another partition), I like the function to extract any type of archive, it is simple but very handy. For ls I have two recommendations: try out the program lsd (with icons for the type of files) and always use --group-directories-first, in my opinion that should be the default option.
In Tip 5 you didn't actually show us the .bashrc additions before sourcing it, luckily it's visible when we moved to Tip 6, but had me rewinding a couple of times to make sure I didn't miss something! Also the certbot example seems better done with a cronjob than a command, but I suppose some people may prefer more control!
You left out the save copy aliases in the video; you go from introducing the scenario to testing it without showing the edits, even referencing that you had by stating that you need to re-source the .bashrc to make it work.
It's usually better to write separate scripts instead of adding functions/aliases into .bashrc. This removes the need to souce the file and keeps it more manageable.
#1 If you want to muck about with your prompt, why do it manually? Plugins exist for a reason. Personally I use Starship, and I am loving it. #2 and #4 are both solved easier and better by replacing ls with something more modern. eza is a popular one.
@@Tech-Guides See, that's the biggest problem I have with Linux daily driving. I have trouble even spotting potential for improvement, and if I want to improve a thing, sure, I can do it myself if I'm willing to wade through a bunch of archaic documentation. But trying to search for and find ready-made solutions is basically impossible.
Why not just use ^l (Ctrl-L) instead of making an alias for clear, that is what it does most of the time anyway, it is the control character for page break, in teletypes it would place your cursor on the top of the next paper fold (so you can rip off your current printout), but in graphic terminals it clears the screen. Originally you had to do an "echo ^l" for the effect, but libedit-based shells are smart enough to know what you intended.
You are a child 😅 I do exactly the opposite: Removal of all pre-install bash configuration, then remove all colored output, set TERM to vt100 (nowadays vt220 because of strange security changes), set ls to something with "-alrt" or "-alrtE" and be finished 😅
I am not going to lie, nano feels rather limited compared to vim to me. Having said that, for ninja-edits nano is faster because you don't have to change between modes so there is a usecase for nano. ;)
What's wrong with nano? I certainly won't use it as my main editor, but it's great for small and quick edits since it's almost always pre-installed in every distro. Also, here's a mandatory "I use Neovim btw".
@@MyOneLastBrainCell Nothing is wrong with nano, the main reason why people react this way is because nano contains less than 1% of the features compared to vim while vim still is as fast as nano. vim stands to nano as nano stands to notepad on Windows or mousepad on Linux. 😆 If you want to do a simple ninja-edit then nano is fine, if you want to write code then nano does not suffice and you need something like vim or code/codium. The right tool for the job, I use vim but I also use nano at times for ninja-edits just because in that case I need less keypresses to get the same result. vim is awesome and every programmer ought to explore it but the switching between modes (typing, functions, visual blocking) requires extra keypresses so for ninja-edits that actually is disadvantages. But for longer texts vim is superior because of all the useful functions. One little thing which I strongly dislike about nano, it doesn't have syntax highlighting out of the box, you need to use some configure file to enable that.
You can also run 'sudo !!' to execute the last command and sudo
Glad I came across your video. Very useful and so well explained. Thanks and subscribed!
Aweseoms I appreciate it!!
Damn, this is top quality content. Subscribed, let's see your channel grow :)
Thank you so much for the support! Got loads of cool videos planned :)
Some people might want to consider typo correction aliases too, like "apt serach='apt search', gerp=grep" etc. Possibly with a "assuming you meant grep instead of gerp, continuing in 3,2,1.." wrapper for safety.
Just 'doomed scrolled' on to your video......excellent info here, great video.
I don't usually bother with too many alias settings etc as I'm swapping between machines so much (and when they're not there you've forgotten the long way of doing it ;)
However, some really good stuff here and I'm learned a few extra tricks from your video.
Not sure about no 9..... s for redo last command with sudo? you didn't show how, so I guess you're writing a function or similar.
Anyway, I do that with the lifesaver short cut sudo !!
!! re runs the last command in history, so sudo !! runs last command in history with sudo :)
I factor most of my .bashrc into separate files. I ended up with the extension .stuff. I put them either in /usr/jda/stuff (systemwide) or ~/bin/my_stuff.d (user). Some are autoloaded, some are not. I use commands starting with . for things like this. So .s will load a .stuff file (e.g. ".s cd" will load all my customisations related to directories).
That's a cool idea. I already outsourced my aliases and my bash-prompt. But it's even smarter to source stuff like longer functions just when they are needed. On the other hand with today's amount of memory and cpu available I doubt you would notice a difference in speed when you open up a new user-shell. Me personally I hate long, cluttered config files and I always want to have a clear and nice to look at bashrc with a bit more comrehensible commenting.
@@audiolatroushearetic1822 It's only a few things like setting up anaconda that I want on demand, rather than by default. So to initialise anaconda, I type .s conda. There are a few other things I don't always want. It's slower the way I do it, but acceptable.
I love that the length of the video is 13:37
Total chance ;)
@@Tech-Guides😂
How does your "c" alias differ from just typing ^L to clear the screen?
Not at all, I didnt know about the latter :)
@@Tech-Guides Your 'c' is an alias to 'clear', whereas ^L that @jamesbond_007 is referring to is an alias to 'clear -x' in which you can still scroll up to see the ouptut. Check 'man clear' ;)
Nice. Thanks for the tips.
Cheers!
rly good video mate keep it
Thank you!
Very nice video with useful content and well explained as well.
Please, let me also add a feedback more than a critic. I didn't appreciated very much the music in the background when you talk,
it's not very loud but to my taste it's a little bit disturbing. Maybe it's just me.
Anyway, very good piece of content.
Thanks.
Thank you very much for the feedback! I'm actually never sure whether I should add background music so I might leave it next time :)
I am not sufficiently lazy to use some of these aliases (like for sudo !!) but some of this definitely is handy, I am going to copypaste it. I like the alias to use rsync instead of cp for when you copy large files (like moving videos to another partition), I like the function to extract any type of archive, it is simple but very handy. For ls I have two recommendations: try out the program lsd (with icons for the type of files) and always use --group-directories-first, in my opinion that should be the default option.
Thanks! And very nice recommendations :)
Very nice well explained video on .bashrc 🎉 thanks a lot suscribeb
In Tip 5 you didn't actually show us the .bashrc additions before sourcing it, luckily it's visible when we moved to Tip 6, but had me rewinding a couple of times to make sure I didn't miss something!
Also the certbot example seems better done with a cronjob than a command, but I suppose some people may prefer more control!
Neat, thank you very much!
My pleasure, thanks for watching
You left out the save copy aliases in the video; you go from introducing the scenario to testing it without showing the edits, even referencing that you had by stating that you need to re-source the .bashrc to make it work.
Ah damn, I've accidentally edited it out...
It's usually better to write separate scripts instead of adding functions/aliases into .bashrc. This removes the need to souce the file and keeps it more manageable.
What do you mean by "separate scripts"? Executables that you add to your path?
@@Tech-Guides Yes. I have almost 100 scripts (I need to do some cleaning lol).
#1 If you want to muck about with your prompt, why do it manually? Plugins exist for a reason. Personally I use Starship, and I am loving it.
#2 and #4 are both solved easier and better by replacing ls with something more modern. eza is a popular one.
Didnt know about those so thanks for the cool suggestions!
@@Tech-Guides See, that's the biggest problem I have with Linux daily driving. I have trouble even spotting potential for improvement, and if I want to improve a thing, sure, I can do it myself if I'm willing to wade through a bunch of archaic documentation. But trying to search for and find ready-made solutions is basically impossible.
Why not just use ^l (Ctrl-L) instead of making an alias for clear, that is what it does most of the time anyway, it is the control character for page break, in teletypes it would place your cursor on the top of the next paper fold (so you can rip off your current printout), but in graphic terminals it clears the screen. Originally you had to do an "echo ^l" for the effect, but libedit-based shells are smart enough to know what you intended.
Oh I didnt know about that, neat!
Thanks for the de-mystification!
Thanks for watching!
I'm looking forward to more videos from you. Remember this comment when you reached 100k subscribers :)
Haha thanks, I've got a lot of cool content planned :)
You are a child 😅 I do exactly the opposite: Removal of all pre-install bash configuration, then remove all colored output, set TERM to vt100 (nowadays vt220 because of strange security changes), set ls to something with "-alrt" or "-alrtE" and be finished 😅
And LANG and LC_ALL to C
Instead "source ~/.bashrc" I use"exec bash" is faster ;)
shopt -s autocd
WTF. Is this serious? A one liner alias for doing a dist-upgrade?!
I think you still need to "update" before you do "dist-upgrade" so an alias makes a lot of sense, but please share your experience if you know better
more terminal stuff
Ill definitely do more!
I cringed a little bit when I saw nano.
To each their own ;)
I am not going to lie, nano feels rather limited compared to vim to me. Having said that, for ninja-edits nano is faster because you don't have to change between modes so there is a usecase for nano. ;)
What's wrong with nano? I certainly won't use it as my main editor, but it's great for small and quick edits since it's almost always pre-installed in every distro.
Also, here's a mandatory "I use Neovim btw".
@@MyOneLastBrainCell Nothing is wrong with nano, the main reason why people react this way is because nano contains less than 1% of the features compared to vim while vim still is as fast as nano. vim stands to nano as nano stands to notepad on Windows or mousepad on Linux. 😆
If you want to do a simple ninja-edit then nano is fine, if you want to write code then nano does not suffice and you need something like vim or code/codium. The right tool for the job, I use vim but I also use nano at times for ninja-edits just because in that case I need less keypresses to get the same result. vim is awesome and every programmer ought to explore it but the switching between modes (typing, functions, visual blocking) requires extra keypresses so for ninja-edits that actually is disadvantages. But for longer texts vim is superior because of all the useful functions.
One little thing which I strongly dislike about nano, it doesn't have syntax highlighting out of the box, you need to use some configure file to enable that.
Didn't even take 1 comment below to find a pretentious Linux user. Classic.
Excellent