You can also run 'sudo !!' to execute the last command and sudo
@dengyun8467 ай бұрын
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.
@TimChilde7 ай бұрын
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 :)
@daveconnolly7462 Жыл бұрын
Glad I came across your video. Very useful and so well explained. Thanks and subscribed!
@Tech-Guides Жыл бұрын
Aweseoms I appreciate it!!
@Chalisque Жыл бұрын
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).
@audiolatroushearetic1822 Жыл бұрын
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.
@Chalisque Жыл бұрын
@@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.
@OfficialViper Жыл бұрын
Damn, this is top quality content. Subscribed, let's see your channel grow :)
@Tech-Guides Жыл бұрын
Thank you so much for the support! Got loads of cool videos planned :)
@rogerkell49647 ай бұрын
I love that the length of the video is 13:37
@Tech-Guides3 ай бұрын
Total chance ;)
@zcavaleiro2 ай бұрын
@@Tech-Guides😂
@peterjansen48267 ай бұрын
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.
@Tech-Guides7 ай бұрын
Thanks! And very nice recommendations :)
@alexdoessudokus7 ай бұрын
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!
@ChozoSR388 Жыл бұрын
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.
@Tech-Guides Жыл бұрын
Ah damn, I've accidentally edited it out...
@joemcaverage81697 ай бұрын
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.
@Tech-Guides7 ай бұрын
What do you mean by "separate scripts"? Executables that you add to your path?
@joemcaverage81697 ай бұрын
@@Tech-Guides Yes. I have almost 100 scripts (I need to do some cleaning lol).
@acuffaro7 ай бұрын
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.
@Tech-Guides7 ай бұрын
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 :)
@jamesbond_0077 ай бұрын
How does your "c" alias differ from just typing ^L to clear the screen?
@Tech-Guides7 ай бұрын
Not at all, I didnt know about the latter :)
@dragonzed7 ай бұрын
@@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' ;)
@maurolimaok8 ай бұрын
Nice. Thanks for the tips.
@Tech-Guides8 ай бұрын
Cheers!
@Marc428 ай бұрын
Neat, thank you very much!
@Tech-Guides8 ай бұрын
My pleasure, thanks for watching
@gabioeste Жыл бұрын
Very nice well explained video on .bashrc 🎉 thanks a lot suscribeb
@ruiduarterrd7 ай бұрын
rly good video mate keep it
@Tech-Guides7 ай бұрын
Thank you!
@frozendude7077 ай бұрын
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.
@Tech-Guides7 ай бұрын
Oh I didnt know about that, neat!
@MasterHigure7 ай бұрын
#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-Guides7 ай бұрын
Didnt know about those so thanks for the cool suggestions!
@MasterHigure7 ай бұрын
@@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.
@cbbcbb68037 ай бұрын
Thanks for the de-mystification!
@Tech-Guides7 ай бұрын
Thanks for watching!
@terryhenyo9216 Жыл бұрын
I'm looking forward to more videos from you. Remember this comment when you reached 100k subscribers :)
@Tech-Guides Жыл бұрын
Haha thanks, I've got a lot of cool content planned :)
@FirstLast-is9xe7 ай бұрын
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 😅
@FirstLast-is9xe7 ай бұрын
And LANG and LC_ALL to C
@TheElias258 Жыл бұрын
Instead "source ~/.bashrc" I use"exec bash" is faster ;)
@aonodensetsu Жыл бұрын
shopt -s autocd
@codeman99-dev7 ай бұрын
WTF. Is this serious? A one liner alias for doing a dist-upgrade?!
@Tech-Guides7 ай бұрын
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
@naranyala_dev7 ай бұрын
more terminal stuff
@Tech-Guides7 ай бұрын
Ill definitely do more!
@tbizzle-km7hg8 ай бұрын
I cringed a little bit when I saw nano.
@Tech-Guides8 ай бұрын
To each their own ;)
@peterjansen48267 ай бұрын
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. ;)
@MyOneLastBrainCell7 ай бұрын
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".
@peterjansen48267 ай бұрын
@@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.
@anudeepk75797 ай бұрын
Didn't even take 1 comment below to find a pretentious Linux user. Classic.