First thing (-x flag) is not actually a Bash feature but already a Bourne shell and POSIX shell feature. Same for the job control although omitting the % prefix for the job number is a Bash thing.
@matan-h
3 ай бұрын
didn't know about `bash -x`. it would have save me some debugging time
@jezura777
3 ай бұрын
I knew this existed, but you put it together very nicely. Great vids!
@Chalisque
3 ай бұрын
Related for vim users: Another approach to the man thing is that you can edit the command line in your editor with Ctrl-x Ctrl-e. If your editor is vim, you can open a man in a separate window by putting the cursor over a word and pressing (in normal mode) Shift-K. Then you can yank/paste between the manpage buffer and your command. Or else (again in C-x C-e) you can use e.g. :new | setlocal buftype=nofile | 0r! ls -h or :vnew | setlocal buftype=nofile | 0r! ls -h to open a new buffer with the output of ls -h in it. (The nofile tells vim that this buffer doesn't need to be saved, so it won't nag you when quitting.)
@Chalisque
3 ай бұрын
On the vim front, my first experience of vim, like some others, was getting into it accidentally when first running (Slackware) Linux in 1996 with no instructions and no internet in my flat, and no idea where to look for help. I tried every key combo I could think of, until Ctrl-z got me out of it. Then I tried to exit bash and it complained that there were jobs. So I type jobs, and then jobs -l, and then discovered kill. So my first way to get out of vim was Ctrl-Z followed by jobs -l and kill -9. But that's how I discovered jobs. (I only discovered fg and bg a bit later.)
@chammy2812
3 ай бұрын
The ‘-x’ was new to me and will be useful going forward. If this video was made a week ago it all would have been new to me, but I recently learned the bf, fg, CTRL-Z stuff last week.
@pouf-dk3nq
3 ай бұрын
Amazing video as always, quick and straight to the point. I didn't know about the bash -x. this is very useful. This channel has easily become my favorite and i don't know why i didn't stumble on it before, keep up the good work
@rafiraf1522
3 ай бұрын
Tmux is something worth learning if you use the terminal, let's you keep both a man page open and try out the command
@user-3v4lx3z1fn
4 күн бұрын
this video is sooooo goooood... thank you, you rock!
@kashnomo
3 ай бұрын
Recently, I learned you can fg with the argument %procname. I had a tail -f in the background. i can call it back with fg %tail. who knew?
@goofballbiscuits3647
3 ай бұрын
I did not 😂 tysm
@plato4ek
3 ай бұрын
Also, you can skip the number when calling `fg` and `bg`. This way they will operate on the last stopped job (which is marked by a `+` in the `jobs` output).
@demo1905
3 ай бұрын
Thanks for the info keep it coming 😮
@rian0xFFF
3 ай бұрын
When writing stuff on terminal, on can use CTRL + A to move the pointer to the beginning and CTRL + E to move to the end
@GenZdev
3 ай бұрын
bro any plan for full setup of yours like how you use wsl so efficiently i have tried it but its not that fast mostly
@GameBacardi
3 ай бұрын
Nice. Good to know 'jobs'
@ItsCOMMANDer_
3 ай бұрын
does the first one also work when setting the interperter to "#!/bin/bash -x"?
@aarond309
3 ай бұрын
passing arguments in the shebang can be inconsistent instead call set -x as the first line of your script (after the shebang) and it will do the same thing
@nirlichtman
3 ай бұрын
On my test it works and also according to the latest kernel source it does handle an argument in the shebang: elixir.bootlin.com/linux/latest/source/fs/binfmt_script.c#L41 but the kernel treats the whole rest of the line as a single argument which can be confusing since if you pass more than one argument to bash it will all be passed to the first argument (and not separately for each arg), from what I understand some other Unix like systems may have different behaviors, so probably best practice is what aarond309 suggested
@ItsCOMMANDer_
3 ай бұрын
thanks!@@nirlichtman
@guilherme5094
3 ай бұрын
👍
@hippie999
3 ай бұрын
how do you use bash? do you do this via WSL or some other method?
@nirlichtman
3 ай бұрын
On this video I use it through WSL, it is also possible to use it directly on Windows (in fact git for windows comes with bash)
@hippie999
3 ай бұрын
@@nirlichtman yes, but I wonder if there is another way other than wsl, cygwin, msys or msys in git?
@matan-h
3 ай бұрын
@@hippie999 yes. In most videos about linux he uses Debian docker container
@hippie999
3 ай бұрын
@@matan-h oh yeah, but is there a shell directly with Windows (bash)?
@plato4ek
3 ай бұрын
@@hippie999 I don't know what you actually mean, but I think it's MSYS2 that you're looking for.
@lpanebr
3 ай бұрын
I've just found your channel and binged a lot of vim and Shell tips. I love the content and I think you'd get tons of subscribers if you only also added the command name in the title! 3 cool bash command: fg jobs bd
Пікірлер: 31