Linux shell magic tricks 🪄

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 122

  • @BreadOnPenguins
    @BreadOnPenguins  6 дней назад

    Part 2 is here: ruclips.net/video/c0Q887QsiJU/видео.html&lc

  • @SlyEcho
    @SlyEcho 18 дней назад +2

    Learned a couple things, definitely!

  • @andresmartinez-sj7ui
    @andresmartinez-sj7ui 20 дней назад +2

    This is fantastic, definitely helpful.
    I'll share these ones with my peers.
    Much appreciated 👍🏽

  • @motokokusanagi2675
    @motokokusanagi2675 27 дней назад +7

    Another one related to braces that I find useful is, let's say you need to create 50 text files inside a folder for any reason, you could run: touch file{1..50}.txt, so in your example it could be: mkdir -p mydir2/dir{1..5}

  • @matthieujoly
    @matthieujoly 26 дней назад +3

    Discovered recently the "^" trick, I already use some few ones, yet it's always a good thing to have a reminder and to discover another !
    Thanks, great vid !

    • @BreadOnPenguins
      @BreadOnPenguins  25 дней назад

      Glad to hear! always more to learn :)
      Thanks!

  • @victorramos3110
    @victorramos3110 28 дней назад +8

    I use linux since 2017 and you make me feel I've been using it for couple weeks

    • @BreadOnPenguins
      @BreadOnPenguins  28 дней назад

      There's always more to learn, every so often I read or see something that makes me feel the same haha

  • @whiskeylinux
    @whiskeylinux 6 дней назад +1

    Very cool tips. Been watching your catalog, great stuff! Wish you all the best.

  • @awauser
    @awauser 28 дней назад +16

    These tips are incredible!
    Here is a cool trick I use:
    As you may know, the pwd command returns the $PWD enviromental variable, but also there's a $OLDPWD variable that stores the previous directory the user was on. That one is parsed by "cd -", as shown on the video. With that, what you can do is use the trap command (or any another) to save $OLDPWD to a file upon exiting the shell session, and then restore it and change directory into it in initialization of new sessions (Note: $OLDPWD gets wiped on exiting). I personally configure those settings on my bash init scripts
    Hope someone finds it useful!

    • @BreadOnPenguins
      @BreadOnPenguins  28 дней назад +2

      Thanks for sharing! That's actually a very good idea, I might use that myself :)

  • @tylower
    @tylower 22 дня назад +2

    DT sent me. Nice channel. Subbed. Good luck!

  • @aelhamamy
    @aelhamamy 26 дней назад +2

    Great video, thank you so much. Some of the best things that helped me as well was having .inputrc file, makes using the shell must easier! like auto completion, history, and so on.
    This is my .inputrc file: cat .inputrc
    set completion-ignore-case on
    set show-all-if-ambiguous on
    set colored-completion-prefix on
    set colored-stats on
    "\e[3~": delete-char
    "\C-h": backward-delete-char
    "\C-?": backward-delete-char
    "\e[A": history-search-backward
    "\e[B": history-search-forward
    set skip-completed-text on
    set bell-style visible
    set show-all-if-unmodified on

    • @BreadOnPenguins
      @BreadOnPenguins  25 дней назад

      Thanks very much for sharing! I'll likely make a vid talking about setting up rc files

  • @AshesWake-sf7uw
    @AshesWake-sf7uw 28 дней назад +6

    Using Tmux is a great way to save time too and just fly through your work, when working on the terminal! I can't imagine working without tmux now 😂
    Awesome video as always

    • @BreadOnPenguins
      @BreadOnPenguins  28 дней назад +4

      I'll have to cover tmux, definitely one of those must-know-about programs. Thanks! :)

    • @Greenmarty
      @Greenmarty 27 дней назад

      Yep, all Tmux needs are three basic plugins resurrect, continuum and sensible for sessions to survive server reboots and community accepted basic config.

    • @chrisalupului
      @chrisalupului 27 дней назад +1

      Yup this, and switching some keybinds from ctrl+b to like ctrl+a and switching panes with ctrl+arrow keys was mind blowing when I added this lol

  • @KM-sv4dh
    @KM-sv4dh 25 дней назад +2

    Nice tips, thanks. I'm saving this video until I get home and experience some of these shortcuts myself.

  • @MarkieAurelius
    @MarkieAurelius 22 дня назад +1

    that last command one is sick, will definitely use it

  • @texaslinux
    @texaslinux 27 дней назад +1

    Awesome tips! I've been using Linux since 2001 and didn't know about the args tricks you showed, wow! You rock.

    • @BreadOnPenguins
      @BreadOnPenguins  27 дней назад +1

      Thanks! Glad I was able to show even a seasoned user something new.

  • @breaddyPL
    @breaddyPL 25 дней назад +1

    Even tho i have been using Linux for only 3 months Im very happy to see some new Linux content creators! Great Video, keep going :] !

    • @BreadOnPenguins
      @BreadOnPenguins  25 дней назад +1

      Welcome to Linux! Thanks so much - will do :)

  • @gamerscodex5454
    @gamerscodex5454 28 дней назад +2

    Kick ass video and channel, you came outta nowhere and drop content like nobody's business!

  • @jack-spade5647
    @jack-spade5647 11 дней назад

    . ...is this the Hyprland experience video? . ...you are saving years of lifespan with all this magic.

  • @mauriereed3875
    @mauriereed3875 28 дней назад +2

    Great video! I’m in for more tips ‘n’ tricks videos.

  • @VioletJewel1729
    @VioletJewel1729 27 дней назад +1

    yayyy I learned something. Forgot about ^replace^. Woooo good video hehe ^_^

  • @TrustJesusToday
    @TrustJesusToday 19 дней назад +1

    Cool tools! Thanks.

  • @ANDROTOP
    @ANDROTOP 25 дней назад +1

    new sub here, coming from dt video, keep it up!

    • @BreadOnPenguins
      @BreadOnPenguins  25 дней назад

      Hey thanks for checking out my channel! I really appreciate it - will do :)

  • @hiryu76
    @hiryu76 27 дней назад +1

    "Yer a wizard, Bready!" 😑 Sorry.. Informative as always. Also I really love your wallpapers!

    • @BreadOnPenguins
      @BreadOnPenguins  27 дней назад +1

      Lol I suppose I had that one coming
      Thanks!

  • @infinitivez
    @infinitivez 24 дня назад +1

    Not sure if I should be embarrassed, having never known these in my years of linux, or happy I know them now?
    I'll pick the latter. Please bring me part 2! ngl, !#: is likely to save me tons of headache

    • @BreadOnPenguins
      @BreadOnPenguins  24 дня назад +1

      Definitely the latter! I frequently learn things that make me question how I didn't know them before :)
      Will do!

  • @aldrikcorbe9605
    @aldrikcorbe9605 27 дней назад +1

    Simple and useful, great video.

  • @cybernit3
    @cybernit3 27 дней назад +2

    Thanks for teaching some tricks, I knew about !! and ctrl-l; but that the !:1 or cd -. Oh ya, instead of cd there is also z (zoxide). Instead of nano text editor there is micro text editor which is easy to use; I just wish LSP client worked on it so you get parameter hints when programming.

    • @BreadOnPenguins
      @BreadOnPenguins  27 дней назад

      No problem. I might check out zoxide for a vid at some point. Thanks for commenting!

  • @PrzemekPr
    @PrzemekPr 28 дней назад +1

    Hi, I'm sure this is great video, but i really write to say that thumbnail look very cute. Thank you for great work on those materials

    • @BreadOnPenguins
      @BreadOnPenguins  27 дней назад

      Thank you! That's very nice of you to say :)

  • @callimas
    @callimas 27 дней назад +8

    I've been using bash since 2000, and some variant of the Bourne shell since the early 90s, though I've never been a power user, and several of these were new to me. I've been using Emacs-style motion/editing key bindings for so long that I could not live without them now. In addition to C-a (control+a), C-e, C-w, and C-k, there's also M-b ("Meta b" = alt+b) to move backward one word, M-f = forward word, M-d to kill (cut) the word to the right, C-y to yank (paste) the thing you most recently killed (cut), M-y to cycle through the kill ring, i.e., successively paste all the things you cut in previous steps......etc.

    • @BreadOnPenguins
      @BreadOnPenguins  27 дней назад

      It makes sense to set bindings to whatever you're already used to - far faster to take a few minutes to set up, than to try to commit new motions to memory.
      I'll likely make some additional videos going over more common shortcuts and tricks for shell.
      Thanks for commenting!

    • @SlinkyD
      @SlinkyD 27 дней назад

      Same but I keep forgetting Meta, not Ctrl cus I don't use 'em a lot.

    • @HaukeLaging
      @HaukeLaging 22 дня назад

      @@BreadOnPenguins I often fail at remembering key bindings I rarely need. The simple solution is e.g. a shell function "h" which prints a short help text (whatever you need) or a static key binding: If I press F1 in my bash then readline inserts and executes this dummy command:
      start cmd:> : "
      cont. cmd:> # set-mark (C-^ SPACE)
      cont. cmd:> # exchange-point-and-mark (C-^ x)
      cont. cmd:> # kill-region (-)
      cont. cmd:> # complete-filename (M-/)
      cont. cmd:> # complete-username (M-)
      cont. cmd:> # complete-variable (M-$)
      cont. cmd:> # complete-hostname (M-@)
      cont. cmd:> # tilde-expand (M-&)
      cont. cmd:> # history-expand-line (M-)
      cont. cmd:> # glob-list-expansions (C-^ l)
      cont. cmd:> # shell-expand-line (M-C-e)
      cont. cmd:> # edit-and-execute-command (C-^ e)"

  • @n3ev
    @n3ev 24 дня назад +1

    nice, more videos like this plz :D

  • @paulhbartley8030
    @paulhbartley8030 25 дней назад +2

    Not sure if this was mentioned, but alt+. is a handy way of quickly retrieving the argument from the last command.

  • @zestynotions
    @zestynotions 9 дней назад +1

    zoxide and yazi are the greatest timesavers for me

    • @BreadOnPenguins
      @BreadOnPenguins  9 дней назад

      Thanks for mentioning! I'll probably make a vid about zoxide at some point :)

  • @dunkelskrue
    @dunkelskrue 19 дней назад +1

    -heard something about uparrow for previous cmd. Ctrl-p for cycling backwards through history is a bit more convenient for lazy people like me who doesnt want to move my hand so much. By far most used daily is ctrl-r for backwards cmd search and alt-dot for cycling through last arguments on prev cmds. Can also use for instance holding down alt through pressing 3 and dot for 3rd arg on prev cmd line. Instead of the version with typing it out with ! Colon etc

    • @BreadOnPenguins
      @BreadOnPenguins  18 дней назад +1

      Thanks for commenting - that's a fair point! I'll be making a part 2 to this video soon, so I'll include those tips

  • @shadowfan1999
    @shadowfan1999 28 дней назад +4

    new vid bros lets go, happy halloween btw

  • @etcher6841
    @etcher6841 28 дней назад +3

    Bread is awesome

  • @rony9225
    @rony9225 28 дней назад +4

    Yay another bread video!🎉

  • @armanism24
    @armanism24 18 дней назад +1

    great

  • @pxldi
    @pxldi 26 дней назад +1

    Great videos, where do you get your wallpapers from though? Love them

    • @BreadOnPenguins
      @BreadOnPenguins  25 дней назад

      Thanks! Recently I've just been looking up landscapes from painters I like. But in general, everything from gallery sites to stock sites to /wg/
      Artist & title is in the description :)

  • @bennockley
    @bennockley 23 дня назад +1

  • @etcher6841
    @etcher6841 28 дней назад +5

    You forgot $_ and co mate, now you gotta make another video on this

    • @BreadOnPenguins
      @BreadOnPenguins  28 дней назад +2

      True plenty more to cover, I'll definitely make a part 2 lol

  • @BrokenKanuck
    @BrokenKanuck 28 дней назад +1

    Love these videos! 🙂 I have my sudo !! aliased as "f*ck"

  • @KavusHabibi
    @KavusHabibi 22 дня назад +1

    hello, how did you change terminal theme and color and font?
    and what is the desktop enviorment? is it xfce4?
    can you make a video about this , please? it is very beautifull

    • @BreadOnPenguins
      @BreadOnPenguins  22 дня назад

      Hello, my terminal is st, and default font and colors are set in its config. I actually use pywal for dynamic colorscheme generation though.
      I've several videos about how I configure my window manager! It's dwm, with dwmblocks for status bar :-)

  • @zerotheory941
    @zerotheory941 26 дней назад +2

    in my .bashrc file i've placed `set -o vi` to enable vim bindings for command line editing. It defaults to insert mode so you don't notice it unless you tap esc and go to command mode where you now have vi to edit the lines or move up and down in history.

    • @BreadOnPenguins
      @BreadOnPenguins  25 дней назад

      Great setting if you find vim bindings easier to use. Thanks for mentioning!

  • @klashe1977
    @klashe1977 25 дней назад +2

    Came here from the distrotube recommendation video. Great content. Now I'm off to bork these shortcuts and accidentally copy some pictures into my systemd service directory. :)

    • @BreadOnPenguins
      @BreadOnPenguins  25 дней назад

      Thanks so much for checking out my channel! Hahaha it happens

  • @ishak_arif
    @ishak_arif 23 дня назад +1

    What do you use to make your videos? I mean screen recording, editing, making thumbnails, etc

    • @BreadOnPenguins
      @BreadOnPenguins  23 дня назад

      Hello, I use ffmpeg for recording, virtually no editing but splicing scripts if ever needed, and I've actually made a video talking about image editing programs. :-)

    • @ishak_arif
      @ishak_arif 23 дня назад +1

      @ Ahh I see. Thank you for your reply. Could you some time perhaps make a video on ffmpeg, and also those scripts?

    • @BreadOnPenguins
      @BreadOnPenguins  23 дня назад

      @@ishak_arif Sure I can do that at some point :)

  • @jellyfishdemo
    @jellyfishdemo 12 дней назад +1

    So cool! I can't tell you how many times I have wanted to cd to the dir I was just in and manually typing out the path multiple times to go back and forth or hope my history has a recent cd to that dir. Now I can just cd - like a wizard. (∩`-´)⊃━☆゚.*・。゚

  • @jkf114
    @jkf114 27 дней назад +2

    To get to your home directory you don't actually need to put the tylda there, just run cd with no arguments
    And also you can use the "-" trick with git switch, very useful if you have long branch names

    • @BreadOnPenguins
      @BreadOnPenguins  27 дней назад

      Thanks for mentioning both of those!

    • @HaukeLaging
      @HaukeLaging 22 дня назад

      The real trick for handling directory changes is pushd / popd (in bash)

  • @karshPrime
    @karshPrime 23 дня назад +2

    Penguins have a unique feather structure that helps to keep them warm in cold water

    • @BreadOnPenguins
      @BreadOnPenguins  23 дня назад

      They have blubber, too! Especially given the regions many species are in, they really have to stay warm lol

  • @techmouse.
    @techmouse. 6 дней назад

    Without any arguments passed, cd will always take you back to home. So the tilde in "cd ~" isn't necessary.

    • @BreadOnPenguins
      @BreadOnPenguins  6 дней назад

      That's true - bad habit, but I've luckily dropped it. That's one of the first things covered in my pt2 of this vid :-)

  • @notafbihoneypot8487
    @notafbihoneypot8487 28 дней назад +1

    Watching this from the term rn 🗿

  • @sqlexp
    @sqlexp 26 дней назад +1

    How can I actually search back in the history for a command that starts with a particular prefix? For example, I want to find a previous cd command, but I don't want the last cd command. I can only use the up key to go through all commands in the history. I want a way to show only commands that start with cd when I press the up key.

    • @BreadOnPenguins
      @BreadOnPenguins  25 дней назад

      You can use ctrl + R (that's the default at least) and then search. Far better searching experience if you install fzf (fuzzy finder) as well :)

    • @HaukeLaging
      @HaukeLaging 22 дня назад

      In bash / readline you can do this:
      # : non-incremental search for the same beginning of a command line
      bind '"\e[5~":history-search-backward'
      # : non-incremental search for the same beginning of a command line
      bind '"\e[6~":history-search-forward'
      Typing "cd ......" then scrolls forth and back through all history entries which start with "cd "

  • @xcoding7513
    @xcoding7513 22 дня назад +1

    I hope you are doing well, I need just to learn Linux Terminal to use in Windows I already set up the WSL with ubuntu, How can N learn using the linux terminal in windows, could you provide me with a road map or a book or a full detailed palylist.

    • @BreadOnPenguins
      @BreadOnPenguins  21 день назад

      Hello, likewise! I've made several videos covering an intro to the Bash shell, if that's what you'll be using :-) If you're trying to learn scripting, I've found the book "bash Cookbook" to be helpful.

  • @Jackovasaur
    @Jackovasaur 27 дней назад +2

    Noob question but what version of linux is this? It looks so clean i want it lol

    • @BreadOnPenguins
      @BreadOnPenguins  27 дней назад +2

      No worries, I'm using Arch with dwm (dynamic window manager), and dwmblocks for my status bar.
      I've got a couple videos going over my setup as well as a long Arch install guide :)

  • @takennmc
    @takennmc 28 дней назад +2

    what do you use for that output for mv and cp

    • @BreadOnPenguins
      @BreadOnPenguins  28 дней назад +1

      It's just an alias for forcing mv & cp to use the -iv flag, set up in the shell config
      cp="cp -iv"
      mv="mv -iv"
      :)

  • @swagmuffin9000
    @swagmuffin9000 27 дней назад +1

    How's that wm? Kinda done with full DEs

    • @BreadOnPenguins
      @BreadOnPenguins  27 дней назад +1

      I made a video going over basics of dwm, and why I prefer tiling WMs - title starts with Arch+dwm
      But for a tl;dr, dwm is very minimal out-of-the-box, and allows for complete customization with patches. I prefer that approach, since you don't end up with any extra features you don't need. So I'd definitely recommend it if you're ready to get your hands dirty with setting up a WM :)

    • @swagmuffin9000
      @swagmuffin9000 26 дней назад

      @ awesome thanks, I'll check out that video

  • @boredsherbet
    @boredsherbet 27 дней назад +2

    just gonna be straight up honest now. I've usenvim for the past 4 months, and I'd like to say I'm not particuarly inapable. this video has left my jaw gaping open. I feel like an idiot. thank you, finlly"

    • @BreadOnPenguins
      @BreadOnPenguins  27 дней назад

      Well I'm glad you learned something from the vid! :D

  • @Ozzymand
    @Ozzymand 27 дней назад +2

    i thought i was the only one that aliases v as neovim, happy to hear other people do that too.

    • @BreadOnPenguins
      @BreadOnPenguins  27 дней назад +1

      💯 The shorter and easier an alias, the better

  • @Rudolfucius
    @Rudolfucius 24 дня назад

    I bet Luke SMITH found her during his trip to eastern europe
    He tough her linux and english

  • @lel7531
    @lel7531 27 дней назад

    Zsh ? Rookie mistake