MUST KNOW bashrc customizations to boost productivity in Linux

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ย. 2024

ความคิดเห็น • 62

  • @candyts-sj7zh
    @candyts-sj7zh 3 หลายเดือนก่อน +4

    You can also run 'sudo !!' to execute the last command and sudo

  • @dengyun846
    @dengyun846 3 หลายเดือนก่อน +2

    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 3 หลายเดือนก่อน +2

    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 10 หลายเดือนก่อน +1

    Glad I came across your video. Very useful and so well explained. Thanks and subscribed!

    • @Tech-Guides
      @Tech-Guides  10 หลายเดือนก่อน

      Aweseoms I appreciate it!!

  • @alexdoessudokus
    @alexdoessudokus 3 หลายเดือนก่อน

    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!

  • @OfficialViper
    @OfficialViper 10 หลายเดือนก่อน +1

    Damn, this is top quality content. Subscribed, let's see your channel grow :)

    • @Tech-Guides
      @Tech-Guides  10 หลายเดือนก่อน +1

      Thank you so much for the support! Got loads of cool videos planned :)

  • @rogerkell4964
    @rogerkell4964 3 หลายเดือนก่อน

    I love that the length of the video is 13:37

  • @peterjansen4826
    @peterjansen4826 3 หลายเดือนก่อน +1

    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  3 หลายเดือนก่อน

      Thanks! And very nice recommendations :)

  • @joemcaverage8169
    @joemcaverage8169 3 หลายเดือนก่อน

    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  3 หลายเดือนก่อน

      What do you mean by "separate scripts"? Executables that you add to your path?

    • @joemcaverage8169
      @joemcaverage8169 3 หลายเดือนก่อน

      @@Tech-Guides Yes. I have almost 100 scripts (I need to do some cleaning lol).

  • @Chalisque
    @Chalisque 10 หลายเดือนก่อน +2

    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 10 หลายเดือนก่อน

      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 10 หลายเดือนก่อน

      @@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.

  • @acuffaro
    @acuffaro 3 หลายเดือนก่อน

    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  3 หลายเดือนก่อน +1

      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 :)

  • @maurolimaok
    @maurolimaok 4 หลายเดือนก่อน

    Nice. Thanks for the tips.

    • @Tech-Guides
      @Tech-Guides  4 หลายเดือนก่อน +1

      Cheers!

  • @ChozoSR388
    @ChozoSR388 10 หลายเดือนก่อน +1

    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  10 หลายเดือนก่อน

      Ah damn, I've accidentally edited it out...

  • @Marc42
    @Marc42 3 หลายเดือนก่อน

    Neat, thank you very much!

    • @Tech-Guides
      @Tech-Guides  3 หลายเดือนก่อน

      My pleasure, thanks for watching

  • @gabioeste
    @gabioeste 10 หลายเดือนก่อน

    Very nice well explained video on .bashrc 🎉 thanks a lot suscribeb

  • @FirstLast-is9xe
    @FirstLast-is9xe 3 หลายเดือนก่อน +1

    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 3 หลายเดือนก่อน

      And LANG and LC_ALL to C

  • @ruiduarterrd
    @ruiduarterrd 3 หลายเดือนก่อน

    rly good video mate keep it

    • @Tech-Guides
      @Tech-Guides  3 หลายเดือนก่อน

      Thank you!

  • @frozendude707
    @frozendude707 3 หลายเดือนก่อน

    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  3 หลายเดือนก่อน +1

      Oh I didnt know about that, neat!

  • @jamesbond_007
    @jamesbond_007 3 หลายเดือนก่อน +1

    How does your "c" alias differ from just typing ^L to clear the screen?

    • @Tech-Guides
      @Tech-Guides  3 หลายเดือนก่อน

      Not at all, I didnt know about the latter :)

    • @dragonzed
      @dragonzed 3 หลายเดือนก่อน

      @@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' ;)

  • @cbbcbb6803
    @cbbcbb6803 3 หลายเดือนก่อน

    Thanks for the de-mystification!

    • @Tech-Guides
      @Tech-Guides  3 หลายเดือนก่อน

      Thanks for watching!

  • @MasterHigure
    @MasterHigure 3 หลายเดือนก่อน

    #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  3 หลายเดือนก่อน

      Didnt know about those so thanks for the cool suggestions!

    • @MasterHigure
      @MasterHigure 3 หลายเดือนก่อน

      @@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.

  • @LinuxIsBetter43
    @LinuxIsBetter43 3 หลายเดือนก่อน

    It's not bad, but what happens when you use someone elses' linux? I mean, you don't remember half of the commands

    • @Tech-Guides
      @Tech-Guides  3 หลายเดือนก่อน

      Well I would hope this is less of a "forget the original" rather than a "convenience" list ;)

    • @ForexStoryteller
      @ForexStoryteller 3 หลายเดือนก่อน

      Write your alias list in a plain file and keep it on a keyring thumb drive, get on their machine, paste in your stuff at the bottom of their bash file, finish up your work, then go back and remove what you pasted in 🤷🏻‍♂️

  • @terryhenyo9216
    @terryhenyo9216 10 หลายเดือนก่อน

    I'm looking forward to more videos from you. Remember this comment when you reached 100k subscribers :)

    • @Tech-Guides
      @Tech-Guides  10 หลายเดือนก่อน

      Haha thanks, I've got a lot of cool content planned :)

  • @TheElias258
    @TheElias258 9 หลายเดือนก่อน

    Instead "source ~/.bashrc" I use"exec bash" is faster ;)

  • @naranyala_dev
    @naranyala_dev 3 หลายเดือนก่อน

    more terminal stuff

    • @Tech-Guides
      @Tech-Guides  3 หลายเดือนก่อน +1

      Ill definitely do more!

  • @codeman99-dev
    @codeman99-dev 3 หลายเดือนก่อน

    WTF. Is this serious? A one liner alias for doing a dist-upgrade?!

    • @Tech-Guides
      @Tech-Guides  3 หลายเดือนก่อน

      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

  • @aonodensetsu
    @aonodensetsu 9 หลายเดือนก่อน

    shopt -s autocd

  • @tbizzle-km7hg
    @tbizzle-km7hg 4 หลายเดือนก่อน +6

    I cringed a little bit when I saw nano.

    • @Tech-Guides
      @Tech-Guides  4 หลายเดือนก่อน +3

      To each their own ;)

    • @peterjansen4826
      @peterjansen4826 3 หลายเดือนก่อน +1

      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 3 หลายเดือนก่อน

      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 3 หลายเดือนก่อน

      @@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 3 หลายเดือนก่อน

      Didn't even take 1 comment below to find a pretentious Linux user. Classic.

  • @giannakossimos1
    @giannakossimos1 10 หลายเดือนก่อน

    Excellent