Linux shell magic tricks 🪄

  Рет қаралды 7,834

Bread on Penguins

Bread on Penguins

Күн бұрын

Пікірлер
@BreadOnPenguins
@BreadOnPenguins Ай бұрын
Part 2 is here: kzbin.info/www/bejne/mWG0aWtthticgLc&lc
@flow5718
@flow5718 Ай бұрын
I've been doing this for a living for more than a decade and still learned some cool new tricks. Thanks! 💯
@AshesWake-sf7uw
@AshesWake-sf7uw 2 ай бұрын
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 2 ай бұрын
I'll have to cover tmux, definitely one of those must-know-about programs. Thanks! :)
@Greenmarty
@Greenmarty 2 ай бұрын
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 2 ай бұрын
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
@DavidLindes
@DavidLindes 11 күн бұрын
9:00 - of course, that could be shortened further to: mkdir -p mydir2/dir{1..3} or, you know (to show off the thing I wanted to show off, which is nesting these), something like: mkdir -p mydir2/{dir{1..3},4thdir} Fun times! :) Great vid, by the way... I hope it's super helpful to many!
@KM-sv4dh
@KM-sv4dh 2 ай бұрын
Nice tips, thanks. I'm saving this video until I get home and experience some of these shortcuts myself.
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
Awesome, have fun with the shortcuts!
@matthieujoly
@matthieujoly 2 ай бұрын
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 2 ай бұрын
Glad to hear! always more to learn :) Thanks!
@awauser
@awauser 2 ай бұрын
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 2 ай бұрын
Thanks for sharing! That's actually a very good idea, I might use that myself :)
@andresmartinez-sj7ui
@andresmartinez-sj7ui Ай бұрын
This is fantastic, definitely helpful. I'll share these ones with my peers. Much appreciated 👍🏽
@BreadOnPenguins
@BreadOnPenguins Ай бұрын
Glad to hear! :-)
@whiskeylinux
@whiskeylinux Ай бұрын
Very cool tips. Been watching your catalog, great stuff! Wish you all the best.
@BreadOnPenguins
@BreadOnPenguins Ай бұрын
Thanks so much! :-)
@victorramos3110
@victorramos3110 2 ай бұрын
I use linux since 2017 and you make me feel I've been using it for couple weeks
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
There's always more to learn, every so often I read or see something that makes me feel the same haha
@aelhamamy
@aelhamamy 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 2 ай бұрын
Thanks very much for sharing! I'll likely make a vid talking about setting up rc files
@penguin2137
@penguin2137 Күн бұрын
just found the time to watch this video and decided to install zsh to use some of these tips
@breaddyPL
@breaddyPL 2 ай бұрын
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 2 ай бұрын
Welcome to Linux! Thanks so much - will do :)
@texaslinux
@texaslinux 2 ай бұрын
Awesome tips! I've been using Linux since 2001 and didn't know about the args tricks you showed, wow! You rock.
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
Thanks! Glad I was able to show even a seasoned user something new.
@MarkieAurelius
@MarkieAurelius 2 ай бұрын
that last command one is sick, will definitely use it
@BreadOnPenguins
@BreadOnPenguins Ай бұрын
Awesome! :-)
@SlyEcho
@SlyEcho Ай бұрын
Learned a couple things, definitely!
@BreadOnPenguins
@BreadOnPenguins Ай бұрын
Awesome, glad to hear!
@mauriereed3875
@mauriereed3875 2 ай бұрын
Great video! I’m in for more tips ‘n’ tricks videos.
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
Thanks! Awesome 👌
@gamerscodex5454
@gamerscodex5454 2 ай бұрын
Kick ass video and channel, you came outta nowhere and drop content like nobody's business!
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
Thanks so much!
@paulhbartley8030
@paulhbartley8030 2 ай бұрын
Not sure if this was mentioned, but alt+. is a handy way of quickly retrieving the argument from the last command.
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
Thanks for mentioning!
@tylower
@tylower Ай бұрын
DT sent me. Nice channel. Subbed. Good luck!
@BreadOnPenguins
@BreadOnPenguins Ай бұрын
Thank you! I appreciate it :-)
@jack-spade5647
@jack-spade5647 Ай бұрын
. ...is this the Hyprland experience video? . ...you are saving years of lifespan with all this magic.
@TrustJesusToday
@TrustJesusToday Ай бұрын
Cool tools! Thanks.
@callimas
@callimas 2 ай бұрын
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 2 ай бұрын
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 2 ай бұрын
Same but I keep forgetting Meta, not Ctrl cus I don't use 'em a lot.
@HaukeLaging
@HaukeLaging Ай бұрын
@@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)"
@infinitivez
@infinitivez 2 ай бұрын
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 2 ай бұрын
Definitely the latter! I frequently learn things that make me question how I didn't know them before :) Will do!
@hiryu76
@hiryu76 2 ай бұрын
"Yer a wizard, Bready!" 😑 Sorry.. Informative as always. Also I really love your wallpapers!
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
Lol I suppose I had that one coming Thanks!
@aldrikcorbe9605
@aldrikcorbe9605 2 ай бұрын
Simple and useful, great video.
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
Thanks! 👍
@ANDROTOP
@ANDROTOP 2 ай бұрын
new sub here, coming from dt video, keep it up!
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
Hey thanks for checking out my channel! I really appreciate it - will do :)
@PrzemekPr
@PrzemekPr 2 ай бұрын
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 2 ай бұрын
Thank you! That's very nice of you to say :)
@cybernit3
@cybernit3 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 2 ай бұрын
No problem. I might check out zoxide for a vid at some point. Thanks for commenting!
@zerotheory941
@zerotheory941 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 2 ай бұрын
Great setting if you find vim bindings easier to use. Thanks for mentioning!
@VioletJewel1729
@VioletJewel1729 2 ай бұрын
yayyy I learned something. Forgot about ^replace^. Woooo good video hehe ^_^
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
Awesome glad to hear! :) Tysm
@rony9225
@rony9225 2 ай бұрын
Yay another bread video!🎉
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
🥳🥳
@shadowfan1999
@shadowfan1999 2 ай бұрын
new vid bros lets go, happy halloween btw
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
Happy Halloween 🎃
@dunkelskrue
@dunkelskrue Ай бұрын
-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 Ай бұрын
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
@n3ev
@n3ev 2 ай бұрын
nice, more videos like this plz :D
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
Will do! :-)
@pxldi
@pxldi 2 ай бұрын
Great videos, where do you get your wallpapers from though? Love them
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
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 :)
@maluch792
@maluch792 11 күн бұрын
wow this really is magic
@klashe1977
@klashe1977 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 2 ай бұрын
Thanks so much for checking out my channel! Hahaha it happens
@zestynotions
@zestynotions Ай бұрын
zoxide and yazi are the greatest timesavers for me
@BreadOnPenguins
@BreadOnPenguins Ай бұрын
Thanks for mentioning! I'll probably make a vid about zoxide at some point :)
@KavusHabibi
@KavusHabibi 2 ай бұрын
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 Ай бұрын
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 :-)
@etcher6841
@etcher6841 2 ай бұрын
You forgot $_ and co mate, now you gotta make another video on this
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
True plenty more to cover, I'll definitely make a part 2 lol
@etcher6841
@etcher6841 2 ай бұрын
Bread is awesome
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
🍞 💯
@armanism24
@armanism24 Ай бұрын
great
@sqlexp
@sqlexp 2 ай бұрын
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 2 ай бұрын
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 Ай бұрын
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 "
@takennmc
@takennmc 2 ай бұрын
what do you use for that output for mv and cp
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
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" :)
@tubeDude48
@tubeDude48 Ай бұрын
Which 'plug-in' are you using in ZSH? Also you might want to do a video on alias' and functions. I keep all of mine in .bash_aliases, rather then .bashrc That way you won't screw-up .bashrc by accident!
@xcoding7513
@xcoding7513 Ай бұрын
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 Ай бұрын
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.
@Nalatonin
@Nalatonin 20 күн бұрын
how do you enable that output when you move or copy files? the 'file4' -> '/run/.....'
@JSiuDev
@JSiuDev 29 күн бұрын
I completely forget about !!, too use to up arrow🤣
@mnky75
@mnky75 Ай бұрын
Do you use Rofi Bread? Not sure many Linux users know about what it does.
@BreadOnPenguins
@BreadOnPenguins Ай бұрын
I use dmenu but I've tried Rofi. It's more powerful than dmenu, but I don't really have a use for that extra functionality, at least right now :-)
@Jackovasaur
@Jackovasaur 2 ай бұрын
Noob question but what version of linux is this? It looks so clean i want it lol
@BreadOnPenguins
@BreadOnPenguins 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 :)
@jkf114
@jkf114 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 2 ай бұрын
Thanks for mentioning both of those!
@HaukeLaging
@HaukeLaging Ай бұрын
The real trick for handling directory changes is pushd / popd (in bash)
@ishak_arif
@ishak_arif 2 ай бұрын
What do you use to make your videos? I mean screen recording, editing, making thumbnails, etc
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
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 2 ай бұрын
@ Ahh I see. Thank you for your reply. Could you some time perhaps make a video on ffmpeg, and also those scripts?
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
@@ishak_arif Sure I can do that at some point :)
@karshPrime
@karshPrime 2 ай бұрын
Penguins have a unique feather structure that helps to keep them warm in cold water
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
They have blubber, too! Especially given the regions many species are in, they really have to stay warm lol
@bennockley
@bennockley 2 ай бұрын
@techmouse.
@techmouse. Ай бұрын
Without any arguments passed, cd will always take you back to home. So the tilde in "cd ~" isn't necessary.
@BreadOnPenguins
@BreadOnPenguins Ай бұрын
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 :-)
@swagmuffin9000
@swagmuffin9000 2 ай бұрын
How's that wm? Kinda done with full DEs
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
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 2 ай бұрын
@ awesome thanks, I'll check out that video
@BrokenKanuck
@BrokenKanuck 2 ай бұрын
Love these videos! 🙂 I have my sudo !! aliased as "f*ck"
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
Thank you! Haha fair enough
@yomajo
@yomajo 17 күн бұрын
4:52 - zsh trick only? tried on bash with no luck.
@BreadOnPenguins
@BreadOnPenguins 15 күн бұрын
Ah might be then! Thanks for letting me know
@jellyfishdemo
@jellyfishdemo Ай бұрын
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. (∩`-´)⊃━☆゚.*・。゚
@boredsherbet
@boredsherbet 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 2 ай бұрын
Well I'm glad you learned something from the vid! :D
@notafbihoneypot8487
@notafbihoneypot8487 2 ай бұрын
Watching this from the term rn 🗿
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
Chad
@Ozzymand
@Ozzymand 2 ай бұрын
i thought i was the only one that aliases v as neovim, happy to hear other people do that too.
@BreadOnPenguins
@BreadOnPenguins 2 ай бұрын
💯 The shorter and easier an alias, the better
@lel7531
@lel7531 2 ай бұрын
Zsh ? Rookie mistake
@Rudolfucius
@Rudolfucius 2 ай бұрын
I bet Luke SMITH found her during his trip to eastern europe He tough her linux and english
Another practical bash script
12:48
Bread on Penguins
Рет қаралды 9 М.
I Was DEFINITELY Using The Wrong Terminal Shell
9:59
DevOps Toolbox
Рет қаралды 69 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
The evil clown plays a prank on the angel
00:39
超人夫妇
Рет қаралды 53 МЛН
小丑教训坏蛋 #小丑 #天使 #shorts
00:49
好人小丑
Рет қаралды 54 МЛН
Writing your first bash script
16:25
Bread on Penguins
Рет қаралды 4,2 М.
How to (actually) learn Linux
11:57
Bread on Penguins
Рет қаралды 24 М.
12 GREAT command line programs YOU recommended!
16:25
The Linux Experiment
Рет қаралды 304 М.
More shell tricks and bash wizardry !
12:13
Bread on Penguins
Рет қаралды 6 М.
Everything You Need To Start Writing Lua
28:15
TJ DeVries
Рет қаралды 49 М.
8 Command Line Tools that will Change Your Terminal Experience
18:46
This may be my favorite CLI tool ever
8:15
typecraft
Рет қаралды 97 М.
Where Did Arch Linux Come From?
16:21
Action Retro
Рет қаралды 146 М.
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН