% man: why did you get a divorce? man:: Too many arguments.
@aliencreation87443 жыл бұрын
lmao
@sethsrc7923 жыл бұрын
I tried this and it open a POSIX Programer's Manual. lol
@aprameynaganur77343 жыл бұрын
@@sethsrc792 its actually the manpage for get
@sethsrc7923 жыл бұрын
@@aprameynaganur7734 ?
@aprameynaganur77343 жыл бұрын
@@sethsrc792 when you write man why did you get a divorce it shows you the manpage for get
@annoyingmime30815 жыл бұрын
I hope you make more of these basics videos.
@yacek12345 жыл бұрын
10:37 "The biggest recomendation I can give you is just git gud"
@gydo19425 жыл бұрын
git: 'gud' is not a git command. See 'git --help'. The most similar command is gui
@bsatyam4 жыл бұрын
@@gydo1942 git: 'gud' is not a git command. See 'git --help'. The most similar command is add
@uuu123434 жыл бұрын
I’m tempted to alias something like that alias git-gud=“git”
@aprameynaganur77343 жыл бұрын
@@uuu12343 lol
@74erPinguin5 жыл бұрын
Never been so close to subscribing to this channel.
@drygordspellweaver87613 жыл бұрын
Lol
@一郎-e1i5 жыл бұрын
Btw, Friedrich Nietzsche also used Zathura for his pdfs: thus spake zathura
@dill__pickles5 жыл бұрын
Wow this a very Luke Smith meme
@stumbling5 жыл бұрын
@@Fooftilly bash: zarathustra: command not found
@一郎-e1i5 жыл бұрын
the Windows Virgin vs. the Unix Chad
@irfangazi14735 жыл бұрын
* Windows Incel
@userPrehistoricman5 жыл бұрын
Wincel
@paultaylor20545 жыл бұрын
Windows just got a terminal lol
@MrEdrftgyuji5 жыл бұрын
The virgin Unix vs the chad TempleOS
@一郎-e1i5 жыл бұрын
@@MrEdrftgyuji RIP Terry
@stumbling5 жыл бұрын
This video increased my testosterone by 53%!
@pwnbag5 жыл бұрын
Up next *What is the worst Linux distro?* Brian Lunduke
@thingyee11185 жыл бұрын
Reeee
@herrpez5 жыл бұрын
I mean... he's not a Linux distro, but he is fucking terrible.
@hanss31475 жыл бұрын
I think he's talking about Lunduke's video on where he answers what the he thinks the worst linux distro is
@sbrazenor25 жыл бұрын
Everyone knows it's Gentoo, when referencing Lunduke's idea of the worst distro.
@alexanderwhite27455 жыл бұрын
@@sbrazenor2 Yah, fuck Gentoo. I use Arch btw
@humanbeing_2 жыл бұрын
Dude.... THANK YOU. I wish you continued to create more of these videos more recently vs so many of the rant/vlog videos. Now, don't get me wrong: you do provide valuable info in (most... if not all) of those videos, however you're so great at teaching things like this so succinctly, in easy to understand/follow videos, I simply would appreciate more of them. Regardless, I appreciate all of the content you create and post for the community & any general viewer. But these happen to fall into the "you don't know what you don't know" catagory. Meaning this info is out there for anyone to learn, but the reason we find out about it or understand it better is because you made a video about it and we come across them coincidentally, or happen to be subscribed. Anyway, cheers.
@stephenreaves32055 жыл бұрын
Luke exiting vim instead of :set filetype=sh??? Has the bloat gotten to him???
@LukeSmithxyz5 жыл бұрын
typing letters is bloat
@brooksman105 жыл бұрын
:e
@axelforsman16425 жыл бұрын
Even better: `:filetype detect`
@realEchoz5 жыл бұрын
I'm pretty sure the fastest way is: :w|:e
@wesleyrm3 жыл бұрын
@@realEchoz Great!
@julioramirez54975 жыл бұрын
Manual of the manual 🤔
@HiPhish5 жыл бұрын
Here is a better Awk script: awk '{print substr($2,2,length($2)-2) " " $1}' This script will print the section number as well as the name of the manual. Luke's script only prints the name, and if a manual resides in multiple sections only the first one will be chosen. If anyone has a simpler way of saying "everything from $2 except the first and last character" let me know.
@realEchoz5 жыл бұрын
sed 's/^\([^ ].*\) (\(.\)).*/\2 \1/'
@A_Box5 жыл бұрын
Thanks! It was kind of obscure to understand pipes the first time around form the text description only. This demonstration would have helped a lot then and even now it is just so clear.
@LPFan335 жыл бұрын
my pipes were not working properly, getting stuck most of the time, but then I was really happy you made a video on plumbing as well
@gavinvales89285 жыл бұрын
uh oh someones planning on moving to dwm...
@KingZero695 жыл бұрын
luke pipes em the right way...
@tahak74115 жыл бұрын
Absolute chad.
@ertwro5 жыл бұрын
I was like "oh, he's gonna explain fifo files and '' " but no. I was wrong oh so wrong.
@rickyoswald5 жыл бұрын
It's not POSIX compliant because line 2 is not terminated by a newline character.
@vmisev5 жыл бұрын
3.206 :D ⠀
@realEchoz5 жыл бұрын
Vim automatically terminates the last line with a newline char.
@rickyoswald5 жыл бұрын
@@realEchoz no it does not. it might be an option but that is not the typical behavior.
@realEchoz5 жыл бұрын
@@rickyoswald Yes it does. You have to set binary and noeol for it to not do this. Try it yourself, create a single line in a text file, save it and cat it and you'll see that it will end in a line break, causing your prompt to appear on the next line, not on the same line as the contents of the file.
@rickyoswald5 жыл бұрын
@@realEchoz >You have to set Oh so what I said then.
@deeznutz23225 жыл бұрын
Thank you my favorite 30 y/o boomer for teaching me the ways of the unix chad, I am forever grateful.
@thecashewtrader33282 жыл бұрын
Yay
@mortkebab28493 жыл бұрын
Typing sounds like a stampeding herd of horses.
@4.0.45 жыл бұрын
"man up" could be used like RTFM.
@airilsra5 жыл бұрын
For my Ubuntu and Linux Mint brethren out there, to have -Tpdf option you need to have groff installed.
@heisenberg9017 Жыл бұрын
Thanks bro, u just saved me from an hour of figuring out what went wrong.
@Alekov_5 жыл бұрын
YT comment section is bloat.
@AlderDragon5 жыл бұрын
I really like the syntax highlighting in your terminal. Is that done through st config?
@Carlitos19935 жыл бұрын
‘Git Gud’ at laying pipe.
@lgroschiensalle Жыл бұрын
My mom once shoulder surfed me while I was chatting on IRC (back in the day when it was still cool :P) and asked me what I meant when asking some guy in a support channel, "How fat is your pipe?". I told her, "Woman, return to the kitchen if you know what's good for you..." Later that day, the ISP called, they were tryin' to sell me some crap-ware "security package" and I was arguing with them about something I can't remember, and told the tech, "Buddy, if you send me another one of those floppy disk with your garbage software on it, I'm gonna: dd if=/dev/zero of=/dev/fd0 bs=4k till the cows come home! Just feed us the pipe and stay out of the security industry". Funny day :P
@ba89945 жыл бұрын
such a chad
@patrickprucha552211 ай бұрын
very useful! I save my manpages because of portability. or have the man's to review anywhere. Good Job!! Many thanks!!!
@Forrest-T5 жыл бұрын
@Luke Great piping! However, one small problem with this example is that there might be more than one man entry in different sections for a given string. For example, "read" is (1) a shell utility that gets input, (2) a Linux system call, (3) a C library function. Each of these has a separate entry, and your script would always select the first one. We can fix it with even MORE piping! man -k . | dmenu -l 30 | sed 's/[()]//g' | awk '{print $2 " " $1}' | xargs -r man -Tpdf | zathura -
@realEchoz5 жыл бұрын
Even easier way, using only awk instead of sed, awk and xargs.: man -k . | dmenu -l 30 | awk 'system("man -Tps " substr($2,2,1) " " $1)' | zathura -
@uuu123434 жыл бұрын
What a friggin chad bruh
@ChipAltmanxD5 жыл бұрын
Thanks Luke! 🤗
@joemulhern5 жыл бұрын
Dude you are amazing, I love these videos so much. How did you start to learn all of this stuff? Is there a certain channel or blog?
@IrizarryBrandon5 жыл бұрын
Great, especially, for when you have to print something! Nice video.
@thefekete5 жыл бұрын
Funny I was messing around with doing this with groffer (1) the other day.. But I like your solution a lot better! I made a couple changes though: man -k . | dmenu -l 30 | awk '{gsub("[()]", "", $2); print $2, $1}' | ( read c || exit; man -Tpdf $c | zathura - ) a) If you don't want to have zathura open up when the script starts, but only when a item is chosen, you can pipe the choice to a subshell an use read instead of xargs. b) This will always open the first match for a man page found in any section. Thus, it will open groff (1) even if the user selects groff (7). A simple addition to the awk command fixes this by including the section number in the man command. c) If if there's no choice, read returns an error code and bails out before opening zathura.
@yash1152 Жыл бұрын
2:28 zathura can read from stdin - woww!!!
@kruxdt63075 жыл бұрын
based
@ashishpatel3505 жыл бұрын
A command named "man"... Feminist outrage intensifies. REEEEEEE 🐸 👌🏽
@al20ov875 жыл бұрын
I tried doing it your way with zathura but since I run Fedora, the packages are not the same and zathura was missing some obscure plugin package. There is a way to do it with evince though: man -Tpdf ls > temp.pdf ; evince temp.pdf ; rm temp.pdf So the whole command ends up being: apropos . | dmenu -l 30 | grep -Eom1 '^[^ ]+' | xargs -r man -Tpdf > temp.pdf ; evince temp.pdf ; rm temp.pdf
@vmisev5 жыл бұрын
This is very good pipes example, but man to pdf script has some problems. Take a 'printf' for example - there is printf(1) and printf(3) /man 1 printf & man 3 printf/ man -k . | grep printf //not very useful in this case. wanna pipes? drill, baby, drill ;>
@danthemango5 жыл бұрын
man oh man is man a good program
@RonnieNissan5 жыл бұрын
wifish list | awk 'FNR>2 {print $1}' | rofi -dmenu | xargs wifish connect Wrote my first script ever, yayyyy, Thank you luke smith. so my script takes the output of wifish list (wifish is a frontend to wpa_supplicant) pips it into awk which reads from line 3 and up and only the first column and pips that into rofi with dmenu functinality (you could just use dmenu though) then it pips it into xargs with the flag -r so it won't execute anything if you hit ESCAPE, but if you hit one of the APs it will connect to it. I am sooo happy hehehe
@godofhack193 жыл бұрын
I actually made this script and use it pretty often, though I made some changes. I noticed that you can only open the default section of any manpage regardless of which one you choose, so I changed it to: man -Tpdf "$(man -k . | dmenu -l 30 | awk '{print ($1, $2)}' | sed 's/ //')" | zathura - that way it pipes "man(1)" or "man(7)", instead of just 'man' for both. Also since I use this on a very old computer, running 'man -k .' takes some time which is annoying, so I created a file 'manlist' that stores the result of that command and update it through my .bash_profile. All in all I ended up with: man -Tpdf "(dmenu -l 30 < ~/.scripts/manlist | awk '{print ($1,$2)}' | sed 's/ //')" | zathura -
@laniusdev2 жыл бұрын
This video inspired me to make make life so much easier. Honestly anyone looking into scripting on Linux, should watch it. I made a more or less one-liner VPN switcher with dmenu, which made my life so much easier.
@DarkusObscurius4 жыл бұрын
That's why terminal is more usefull than GUI.
@fitzpatrickmathemati5 жыл бұрын
Would be cool to add a flag to mainsplain to let the user "prechoose" the man page. Maybe "mainsplain -s cd" automatically opens the man page for cd in a pdf.
@___xyz___4 жыл бұрын
xargs is glorious
@slackerengi24015 жыл бұрын
Liked just for Man -k . Thanks boomer Luke
@yomajo Жыл бұрын
Sweet fucking lord. One question. When PDF is displayed, is there a file somewhere, or is it read from memory?
@Arunscape5 жыл бұрын
the virgin Luke tutorial vs the chad ` cat /dev/urandom | base64 | lolcat `
@patrickprucha552211 ай бұрын
Functions are good. I had one but decided to go with scripts. If you do it right you can call a specific script multiple times
@rodrigosouto95024 жыл бұрын
Great tricks, thanks!
@rnrteg5 жыл бұрын
New to your channel, love this video and the others I've seen. Quick question, I'm getting an error using man -Tpdf saying that groff thinks pdf is an invalid device. Is there some additional program I need to get this piece working?
@JrIcify5 жыл бұрын
There are arguments against the idea of pipes but I like them.
@jimbarino25 жыл бұрын
What's really cool (for Windows losers) is powershell pipes, which pass whole objects. Next level stuff...
@shady4tv4 жыл бұрын
6:50 Why use awk when you can just use: cut -d ' ' -f1 output spacing is predictable so cut might be a bit faster than invoking awk for something so simple. (awk is bloat) unix.stackexchange.com/questions/132313/what-are-the-exact-differences-between-awk-and-cut-with-grep
@AaronBonBarron5 жыл бұрын
I really like your squishy brain
@jesswoode26273 жыл бұрын
wow thats amazing
@kainbre5 жыл бұрын
How about script that allerts you when you reach crittical battery level? Btw thanks for the video and Larbs!
@32th5 жыл бұрын
I attempted that one and what I came up with is a udev event that sends a signal to a C program which sends a notification. I did that because a command caused by a udev event runs as root but the notification has to be sent as user
@aayushnp54305 жыл бұрын
Very nice! I love these types of videos
@Griimnak5 жыл бұрын
mah nigga.jpg
@OmyTrenav5 жыл бұрын
Your videos are great. Thanks! Quick question: you mentioned there are reasons why you prefer using scripts over functions. What are those reasons? Thanks.
@mortyk373 жыл бұрын
He explained that xargs can read from scripts, not functions
@lnus78323 жыл бұрын
awk is pretty chonker tho, so `cut -f 1` is a good alternative for such a simple usecase
@nahushgaikwad5 жыл бұрын
Awsome knowlege... Would like to see more of such things
@ederbit5 жыл бұрын
#02:21 - you can just do 'pacman -Qqs zathura' if you didn't know about that
@MrNpkellogg4 жыл бұрын
wayyyy outta my pay grade.
@tejasn38354 жыл бұрын
how do you run the command at 9:41 without any terminal open
@PandemicGameplay4 жыл бұрын
Just want to say this video is freakin awesome
@tracy_gao4 жыл бұрын
I just want to say this guy is pretty cool, even I still don't understand what he did.
@amir789895 жыл бұрын
Can I get a link to buy your keyboard Luke?
@LukeSmithxyz5 жыл бұрын
www.pckeyboard.com/page/product/UB40PGA
@genericgamer13193 жыл бұрын
you mentioned that xargs creates a sub=shell is there any process that doesn't do that i wonder it's the old fork & exec
@saturnemgs5 жыл бұрын
I wish I knew about dmenu much sooner. I used to use a zenity based bash function and index files that do what dmenu does. Now I'm gonna have to update a whole bunch of scripts. Thanks ..?
@qiuyue40823 жыл бұрын
Why my brain has hard time to understand xargs?
@eyupyorulmaz34105 жыл бұрын
-l stands for --lines
@gmodrules1234567894 жыл бұрын
*converts man page to pdf* Wait, that's illegal
@lthiaggo5 жыл бұрын
You could cover pipes with redirections in a future video ^^
@chadgrant88704 жыл бұрын
great content! keep it up!
@jtrickett19743 жыл бұрын
Newb here. Any way to make zathura open *after* the desired manpage has been selected?
@Артем-щ1ш3у5 жыл бұрын
xargs which is desinged for handling multiple arguments makes script bloated because end result is a single word. For me it is reasonable to write this sequence like man -Tpdf `man -k . | dmenu -l 30 | awk '{print $1}'` | zathura -
@emanuele65 жыл бұрын
The point of the video was to only use one pipe (your script is not just one single pipe). Also you could argue that " awk '{print $1}' " is overkill (or as you kids say, bloat) because you can just " cut --delimiter=' ' --field=1 " (or " cut -d' ' -f1 " for short). I think it's pointless to make this sort of discussions. EDIT: Corrected typo: "delimeter" -> "delimiter"
@nerrufam71055 жыл бұрын
error: Error parsing command line arguments: Unknown option -
@emanuele65 жыл бұрын
@@nerrufam7105 Try writing the command by and: it works for me writing it by hand but not copying (the command is correct: it should work)
@emanuele65 жыл бұрын
found the problem: COMMAND: $ echo ' - ' | xxd 00000000: 202d efbb bf20 0a COMMAND: $ echo ' - ' | xxd 00000000: 202d 200a He probably used an unicode character instead of the standard -
@nerrufam71055 жыл бұрын
@@emanuele6 that is weird, thanks for the reply
@antuacharjee91455 жыл бұрын
Nice syntax highlighting on your shell. Have you switched to fish??
@astralchan3 жыл бұрын
10:16 the -r flag for xargs isn't POSIX
@nonenothingnull5 жыл бұрын
*MAN* REEEEEEEE SECIEZT
@reverseila43634 жыл бұрын
0) Thanks!
@va9iff3 ай бұрын
I'd use fzf instead of dmenu
@kowsirahmed56683 жыл бұрын
Wow!!
@rev0lu7ion5 жыл бұрын
Cool stuff. This is why we use *nix.
@JamesCaseyPhD5 жыл бұрын
echo "!!" > file.sh
@killianogrady-walshe42133 жыл бұрын
Using man man since pop wasn't around.
@reverseila43634 жыл бұрын
I have two problems: 1. When i run this script before even i choose my man page zathura is opened. 2. I put this script in a PATH folder but everytime i have to source .profile to use it in my bash terminal. Os: debian (sid)
@merajularefinpial36393 жыл бұрын
When I run the script and if I press escape on dmenu to select nothing, zathura still opens a blank window. Can I solve this somehow?
@mikeazarov82385 жыл бұрын
m a n s p l a i n i n g
@surferbum6184 жыл бұрын
Nice
@alurma5 жыл бұрын
Very cool. But why do we have to write "xargs -r man -Tpdf" instead of just "man -Tpdf". Like we didn't have to use xargs in the command after the first pipe
@streetster205 жыл бұрын
`man xargs` will explain it. But it takes in stdin and appends it to the command. So `echo ls | xargs -r man -Tpdf` = `man -Tpdf ls`. The man script can't use/read stdin for an argument.
@serge83173 жыл бұрын
How can I install dmenu on CentOS please? Thanks
@coon-si3ce5 жыл бұрын
I was wondering about that pacman command. Checked what it would do for me, but didn't have it. So I did an apt-get install pacman and...... I got a pacman game.
@chidaruma_5 жыл бұрын
Cool video, but what does Puffy have to do with this? Lol
@roi125555 жыл бұрын
how does xargs knows where to place the so as an argument?
@LukeSmithxyz5 жыл бұрын
By default, it will put it at the end of the "string", but you can specify where it goes with -I. See the follow-up video I just put up now.
@jonahsimmons3645 Жыл бұрын
HELP: How can i remove the "tmp" file from this? objective: get a list of all the TODO comments in my code, be able to select one and edit that file and line in my code current command: grep -rn //TODO: src | dmenu -l 20 > tmp; nvim $(cut -d : -f 1 tmp) +$(cut -d : -f 2 tmp) I've read through all of the xargs and cut man pages and idk what to do (although it's probably a bash thing rather than a specific command thing)
@thierrybo63045 жыл бұрын
Don't get the point to output to PDF if it is just for reading it. Much simpler to just display the legacy man output. Usually if i want to keep a PDF, this is because I will annotate it. For that I use `yelp man:manpage` and print to PDF from there.
@ShamanSenra23 күн бұрын
i just use fzf
@KaelinatorPVP5 жыл бұрын
Why does he bother fiddling with xargs? Couldn't he just have said: ... | awk 'print man -Tpdf $1' | zathura -
@realEchoz5 жыл бұрын
That's not valid AWK, but you could use this to achieve the same thing: ... | awk 'system("man -Tps " $1)' | zathura -