MUST KNOW bashrc customizations to boost productivity in Linux

  Рет қаралды 9,851

Tech Guides

Tech Guides

Күн бұрын

Пікірлер: 61
@candyts-sj7zh
@candyts-sj7zh 7 ай бұрын
You can also run 'sudo !!' to execute the last command and sudo
@dengyun846
@dengyun846 7 ай бұрын
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.
@TimChilde
@TimChilde 7 ай бұрын
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
@daveconnolly7462 Жыл бұрын
Glad I came across your video. Very useful and so well explained. Thanks and subscribed!
@Tech-Guides
@Tech-Guides Жыл бұрын
Aweseoms I appreciate it!!
@Chalisque
@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
@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
@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
@OfficialViper Жыл бұрын
Damn, this is top quality content. Subscribed, let's see your channel grow :)
@Tech-Guides
@Tech-Guides Жыл бұрын
Thank you so much for the support! Got loads of cool videos planned :)
@rogerkell4964
@rogerkell4964 7 ай бұрын
I love that the length of the video is 13:37
@Tech-Guides
@Tech-Guides 3 ай бұрын
Total chance ;)
@zcavaleiro
@zcavaleiro 2 ай бұрын
@@Tech-Guides😂
@peterjansen4826
@peterjansen4826 7 ай бұрын
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-Guides
@Tech-Guides 7 ай бұрын
Thanks! And very nice recommendations :)
@alexdoessudokus
@alexdoessudokus 7 ай бұрын
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
@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
@Tech-Guides Жыл бұрын
Ah damn, I've accidentally edited it out...
@joemcaverage8169
@joemcaverage8169 7 ай бұрын
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-Guides
@Tech-Guides 7 ай бұрын
What do you mean by "separate scripts"? Executables that you add to your path?
@joemcaverage8169
@joemcaverage8169 7 ай бұрын
@@Tech-Guides Yes. I have almost 100 scripts (I need to do some cleaning lol).
@acuffaro
@acuffaro 7 ай бұрын
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-Guides
@Tech-Guides 7 ай бұрын
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_007
@jamesbond_007 7 ай бұрын
How does your "c" alias differ from just typing ^L to clear the screen?
@Tech-Guides
@Tech-Guides 7 ай бұрын
Not at all, I didnt know about the latter :)
@dragonzed
@dragonzed 7 ай бұрын
@@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' ;)
@maurolimaok
@maurolimaok 8 ай бұрын
Nice. Thanks for the tips.
@Tech-Guides
@Tech-Guides 8 ай бұрын
Cheers!
@Marc42
@Marc42 8 ай бұрын
Neat, thank you very much!
@Tech-Guides
@Tech-Guides 8 ай бұрын
My pleasure, thanks for watching
@gabioeste
@gabioeste Жыл бұрын
Very nice well explained video on .bashrc 🎉 thanks a lot suscribeb
@ruiduarterrd
@ruiduarterrd 7 ай бұрын
rly good video mate keep it
@Tech-Guides
@Tech-Guides 7 ай бұрын
Thank you!
@frozendude707
@frozendude707 7 ай бұрын
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-Guides
@Tech-Guides 7 ай бұрын
Oh I didnt know about that, neat!
@MasterHigure
@MasterHigure 7 ай бұрын
#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
@Tech-Guides 7 ай бұрын
Didnt know about those so thanks for the cool suggestions!
@MasterHigure
@MasterHigure 7 ай бұрын
@@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.
@cbbcbb6803
@cbbcbb6803 7 ай бұрын
Thanks for the de-mystification!
@Tech-Guides
@Tech-Guides 7 ай бұрын
Thanks for watching!
@terryhenyo9216
@terryhenyo9216 Жыл бұрын
I'm looking forward to more videos from you. Remember this comment when you reached 100k subscribers :)
@Tech-Guides
@Tech-Guides Жыл бұрын
Haha thanks, I've got a lot of cool content planned :)
@FirstLast-is9xe
@FirstLast-is9xe 7 ай бұрын
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-is9xe
@FirstLast-is9xe 7 ай бұрын
And LANG and LC_ALL to C
@TheElias258
@TheElias258 Жыл бұрын
Instead "source ~/.bashrc" I use"exec bash" is faster ;)
@aonodensetsu
@aonodensetsu Жыл бұрын
shopt -s autocd
@codeman99-dev
@codeman99-dev 7 ай бұрын
WTF. Is this serious? A one liner alias for doing a dist-upgrade?!
@Tech-Guides
@Tech-Guides 7 ай бұрын
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_dev
@naranyala_dev 7 ай бұрын
more terminal stuff
@Tech-Guides
@Tech-Guides 7 ай бұрын
Ill definitely do more!
@tbizzle-km7hg
@tbizzle-km7hg 8 ай бұрын
I cringed a little bit when I saw nano.
@Tech-Guides
@Tech-Guides 8 ай бұрын
To each their own ;)
@peterjansen4826
@peterjansen4826 7 ай бұрын
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. ;)
@MyOneLastBrainCell
@MyOneLastBrainCell 7 ай бұрын
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".
@peterjansen4826
@peterjansen4826 7 ай бұрын
@@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.
@anudeepk7579
@anudeepk7579 7 ай бұрын
Didn't even take 1 comment below to find a pretentious Linux user. Classic.
@giannakossimos1
@giannakossimos1 Жыл бұрын
Excellent
Let's Share Our Favorite Bash Aliases
16:28
DistroTube
Рет қаралды 33 М.
Have you ever used the "column" command in Linux?
8:24
Veronica Explains
Рет қаралды 148 М.
ВЛОГ ДИАНА В ТУРЦИИ
1:31:22
Lady Diana VLOG
Рет қаралды 1,2 МЛН
Война Семей - ВСЕ СЕРИИ, 1 сезон (серии 1-20)
7:40:31
Семейные Сериалы
Рет қаралды 1,6 МЛН
-5+3은 뭔가요? 📚 #shorts
0:19
5 분 Tricks
Рет қаралды 13 МЛН
Napkin AI 2025 | The FREE Ultimate Text to Diagram Tool!
7:03
Gurru Tech Solutions
Рет қаралды 1,4 М.
I Was DEFINITELY Using The Wrong Terminal Shell
9:59
DevOps Toolbox
Рет қаралды 75 М.
grep: A Practical Guide
13:55
Navek
Рет қаралды 78 М.
12 GREAT command line programs YOU recommended!
16:25
The Linux Experiment
Рет қаралды 311 М.
Stow has forever changed the way I manage my dotfiles
8:09
Dreams of Autonomy
Рет қаралды 281 М.
My .bashrc and the command prompt.
12:06
JustAGuy Linux
Рет қаралды 4,3 М.
Solving the Dotfiles Problem (And Learning Bash)
8:22
Bartek Spitza
Рет қаралды 94 М.
Some bashrc recommendations and what I use
19:17
Luke Smith
Рет қаралды 116 М.
ВЛОГ ДИАНА В ТУРЦИИ
1:31:22
Lady Diana VLOG
Рет қаралды 1,2 МЛН