Tap to unmute

So Many Linux Terminal Commands Do The Same Thing

  Рет қаралды 21,281

DistroTube

DistroTube

Күн бұрын

Пікірлер: 125
@KatzRool
@KatzRool 3 жыл бұрын
for a video with such a general title I didn't expect you to talk about wc for so long
@KatzRool
@KatzRool 3 жыл бұрын
so true
@Steerable6827
@Steerable6827 3 жыл бұрын
Another example: parted, fdisk, cfdisk, sfdisk, gdisk cgdisk, sgdisk
@demipy
@demipy 3 жыл бұрын
Well they have quiet different features tho. And even different purposes
@Steerable6827
@Steerable6827 3 жыл бұрын
@@demipy i get what you mean, but many people use them for the exact same purpose with no differences but the app they choose to use
@demipy
@demipy 3 жыл бұрын
@@Steerable6827 yea thats right - but this seems to come down to personal preferences of guide writers. Every guide uses another one :D
@solarwolf678
@solarwolf678 3 жыл бұрын
I feel like a noob that I only used gparted, cfdisk, and cgdisk
@lawrencedoliveiro9104
@lawrencedoliveiro9104 3 жыл бұрын
I thought it would be worthwhile to back up the partition tables on my disks, just on the off chance they get corrupted somehow. I use “sfdisk -d” for this. This can be restored without overwriting the boot loader. Do the other partitioning tools offer similar functionality? I remember being scared off parted some years ago because it could not accurately restore partition locations. I think that might be fixed now.
@agemans_stuff
@agemans_stuff 3 жыл бұрын
Linux is impressing. I used Windows for almost 30 years and I loved it. But since about two years I switched to Linux, because my harddisk crashed during an unstoppable Windows update and I will never switch back to Windows again. I really love the freedom Linux is giving me.
@lakshaynz
@lakshaynz 3 жыл бұрын
this happened to me a few years ago in middle of uni, I started using Linux instead of windows in my laptop and today I work as a DevOps engineer and work with linux mostly. Thanks to the BSOD. It made me learn linux which helped me get this job :)
@konstantink07
@konstantink07 Жыл бұрын
​@@lakshaynzit wasn't "thanks to the bsod", it was thanks to crashes that caused it to appear🤦‍♂️ Linux with Systemd is getting one too btw, and it's a good thing!
@yeswhynot4659
@yeswhynot4659 3 жыл бұрын
Hey DT, you can use the 'count' command in the fish shell for the same result. For example, 'pacman -Qq | count' is the same as 'pacman -Qq | wc -l', just with an easier to read syntax. This also works with count $VAR or count < FILE
@blank-mq8ef
@blank-mq8ef 3 жыл бұрын
if its a fish specific thing i understand not showing it since most distros dont use fish as the default shell
@yeswhynot4659
@yeswhynot4659 3 жыл бұрын
@@blank-mq8efYes, I agree. I just mentioned it because DT used fish in this video.
@huantian
@huantian 3 жыл бұрын
Do take care, as apparently llvm includes a count binary as well, which does something different.
@blank-mq8ef
@blank-mq8ef 3 жыл бұрын
@@yeswhynot4659 ye i getcha, i use fish myself so its gonna be useful for me, but it would have confused the shit out of me when i started using linux a year ago
@SimGunther
@SimGunther 3 жыл бұрын
Let's do a REAL rework of all the binutil programs, not just fancy recoloring or tablature of old programs!
@user-he4ef9br7z
@user-he4ef9br7z 3 жыл бұрын
no
@0xDEAD_Inside
@0xDEAD_Inside 3 жыл бұрын
Yes
@syedahkam7164
@syedahkam7164 3 жыл бұрын
Like what?
@valsharess-yt
@valsharess-yt 3 жыл бұрын
U wot m8
@SimGunther
@SimGunther 3 жыл бұрын
@@syedahkam7164 +1 to fixing unused/poor flags +1 to fixing security issues with binutils -1 to having 6+ commands that do literally the same thing -1 to programs like exa and bat whose sole purpose is to recolor/prettify existing commands +1 for SIMD usage +1 for JIT/compile time computations +1 for better user experience improvements and legibility via the terminal such that we can toggle between table view and terminal/try view if necessary
@demerit5
@demerit5 3 жыл бұрын
Love your videos. Thank you for another great upload
@enslaven00bs
@enslaven00bs 3 жыл бұрын
You don't need to cat into wc. You can run wc directly on the file.
@dkosmari
@dkosmari 3 жыл бұрын
Or you can be a sigma user and cat into cat into cat into cat into cat until you fill the whole line with cats and pipes.
@danielvo3750
@danielvo3750 3 жыл бұрын
i think he said he only wanted the count and running wc directly on the file also returns the filename as well
@matthiaswindrich9697
@matthiaswindrich9697 3 жыл бұрын
I'm also thinking that teaching new linux users about the useless use of cat would have been more valuable than omitting the file name in the output of wc -l filename. One could use the following: wc -l < /etc/hosts
@alejandrogastonfigueroaame4693
@alejandrogastonfigueroaame4693 3 жыл бұрын
WC uses the kernel to read the file, and hence pretty fast. You can use the same code to read your files into memory. Big files. It takes you just to type a couple of letters ... This is a big difference when you are crafting piped/nested commands.
@PhilipHarwell
@PhilipHarwell 3 жыл бұрын
I really enjoyed this video!
@lawrencedoliveiro9104
@lawrencedoliveiro9104 3 жыл бұрын
8:44 If you want a ready-made empty file to demonstrate your point, try /dev/null.
@vince6792
@vince6792 3 жыл бұрын
Great learning vid DT! More help with terminal commands will help new and intermediate users. So many people are intimidates by the terminal when in actuality it's incredibly useful in so many numerous ways. Thanks DT 😌
@dontdex8221
@dontdex8221 3 жыл бұрын
Learn what? He's being elitist
@alexandermendez9013
@alexandermendez9013 3 жыл бұрын
@@dontdex8221 lol
@vince6792
@vince6792 3 жыл бұрын
@@dontdex8221 your ideology isn't going to get you far. He's inadvertently teaching Linux users terminal commands are nothing to fear and helpful to the end user with an example which is how we learn best for the most part. Elitist 🙄
@paulspl2581
@paulspl2581 3 жыл бұрын
@@dontdex8221 he can be elitist and still teach things. Also it's inherently wrong to be elitist. I consider myself an elitist, I want the best for the community
@vince6792
@vince6792 3 жыл бұрын
@@paulspl2581 an elitist is an over inflated egotistical self worth and image. By any metric chosen to measure it's impact on merits it miserably fails in terms of character which is the driving force of achievement. Discipline, determination, and hard work would serve you and your community far better with a sense of humble humility.
@SlyPearTree
@SlyPearTree 3 жыл бұрын
"Is there anything you can't do with grep, sed or awk?" Make them go out in the cold to buy beer.
@BrucesWorldofStuff
@BrucesWorldofStuff 3 жыл бұрын
Or Bourbon... :-p
@ashwinalagiri-rajan1180
@ashwinalagiri-rajan1180 3 жыл бұрын
You can probably get them to do that too 😂
@ped7g
@ped7g 3 жыл бұрын
ok, that's probably too difficult for them, but how long were you sitting and staring at the screen before you found that one? I would assume like hours, considering how grep+sed+awk can do pretty much ANYTHING... [almost]... :)
@glensmith491
@glensmith491 3 жыл бұрын
You just have to be specific. If you want them to BUY beer, you have to use the -brand, -beer and -store flags (you have to use a store that delivers and you need an internet connection).
@umka7536
@umka7536 3 жыл бұрын
wc -l "file-name" works fine. No need to cat.
@AndyDavis007
@AndyDavis007 3 жыл бұрын
Hey DT a nube question here generally far from related to this topic. When you publish a video here, are you also posting an nft to KZbin's ledger?
@rajneesh0045
@rajneesh0045 3 жыл бұрын
One of the best LUT so far
@plutorocks1
@plutorocks1 3 жыл бұрын
Not gonna lie but your voice gives me sorta high confidence and makes me feel more interested in Linux
@AshnSilvercorp
@AshnSilvercorp 3 жыл бұрын
This was me with chmod and chown. I kept trying to understand chmod to change permissions and ownership and just gave up because chown let me do the same thing.
@backseatgaming2145
@backseatgaming2145 3 жыл бұрын
Duct tape everything with chmod -R 777
@AshnSilvercorp
@AshnSilvercorp 3 жыл бұрын
@@backseatgaming2145 even I don't know everything about Linux yet and I'm certain that is the equivalent of deleting system 32.
@backseatgaming2145
@backseatgaming2145 3 жыл бұрын
@@AshnSilvercorp no, the equivalent of deleting system32 would be to sudo rm -rf /* or even just /usr chmod -R 777 when applied to a directory recursively grants full access to each file and directory inside it to everyone (rwx to owner, group and others) That breaks some programs that check access rights (for example ssh) but it's more of a security concern than literally nuking your system It's a common "easy fix" when some program can't access a place due to incorrect configuration and obviously a pretty bad one)
@AshnSilvercorp
@AshnSilvercorp 3 жыл бұрын
@@backseatgaming2145 something like that. That was another reason why I didn't use chmod because most were just saying "use this chmod command to make the file public." I'm the only user on my system, but even I know that's a potential security problem.
@backseatgaming2145
@backseatgaming2145 3 жыл бұрын
@@AshnSilvercorp thats's cool, user experience is always better when you think what you're doing, but if you have not done it yet, i really suggest reading a bit about chmod and access rights in general. It's really beneficial to understand them and can help troubleshooting and even solving issues. I have a recent example with docker, something happened with my config and my user wasn't allowed to use /var/run/docker.sock and i fixed it with chmod
@chuanqisun
@chuanqisun 3 жыл бұрын
The diversity of species in any ecosystem is always a "feature", not a "bug".
@vince6792
@vince6792 3 жыл бұрын
This sounds academically correct until you determine the definition of 'bug'. This hypothesis is no longer scientifically correct regardless of the analogy being evolutionary or pro creation
@nolan412
@nolan412 3 жыл бұрын
Could also use Emacs, Ruby, Python, Perl, etc etc. Or Bash's read function.
@nolan412
@nolan412 3 жыл бұрын
That read function has some power too.
@Not-THAT-ChrisPratt
@Not-THAT-ChrisPratt 3 жыл бұрын
NOOO! Just as there MUST BE just ONE Linux Distro, there MUST BE just ONE way to do this, and ONLY ONE!!!! Just kidding, another great video on the flexibility of Linux and the CLI. Thank you so very much!
@kylebaker1839
@kylebaker1839 3 жыл бұрын
Is that the angels and airwaves logo I see in the background.
@Gooberpatrol66
@Gooberpatrol66 3 жыл бұрын
Suckless devs be like: "let's find all the ways to do something and remove all but one"
@gwgux
@gwgux 3 жыл бұрын
It's good we have so many different ways of doing the same thing. The more we reinvent the wheel, the more wheels we have to choose from to better fit the situation we're in.
@nyrization
@nyrization 3 жыл бұрын
why wheel have to be round lets make it square !! so many ideas !!
@stephanhuebner4931
@stephanhuebner4931 3 жыл бұрын
Yes, and it's fun to have countless people bickering about what solution works best (where "more convoluted" is better) instead of doing something that actually makes Linux easier to use.
@gwgux
@gwgux 3 жыл бұрын
@@nyrization lol, Triangles FTW!
@PaulvanSchaik
@PaulvanSchaik 3 жыл бұрын
He DT, thanks for the video, learning new things every day. What’s the color-things at term start?
@sudomyju5017
@sudomyju5017 3 жыл бұрын
hi! Could you please share what is that desktop wm and terminal app /shell combination you are using here?
@ssteward1992
@ssteward1992 3 жыл бұрын
Pretty sure he uses XMONAD as the WM and uses Alacritty+Fish as his terminal emulator/shell combo.
@sudomyju5017
@sudomyju5017 3 жыл бұрын
@@ssteward1992 loox cool, tx
@thundreturtle
@thundreturtle 3 жыл бұрын
There is nothing you can not do with awk, sed and grep
@007arek
@007arek 3 жыл бұрын
Awk as a programming language is very limited.
@AndersJackson
@AndersJackson 3 жыл бұрын
Why use cat(1) and pipe into wc(1) and nl(1), when you can add that to the commands directly? tee(1) are actually a reason to pipe like that. Create an empty file with touch(1) command. Except that, good introduction, as usually.
@tk36_real
@tk36_real 3 жыл бұрын
Hey, I'm sure this makes sense to someone who isn't actually a beginner, but HERE I AM. I was just always wondering what these numbers mean, and as you seem to know I couldn't not ask you 🤗 Sorry to distract from the content, but first things first, right?
@tk36_real
@tk36_real 3 жыл бұрын
@gu4t4f4c thanks 👍
@konstantink07
@konstantink07 Жыл бұрын
touch is BLOATED🫃, use ">"🗿
@evilzach1586
@evilzach1586 3 жыл бұрын
he should rename the video to 5 ways to get a line count
@EkmekArasiKofte242
@EkmekArasiKofte242 3 жыл бұрын
Why linux over BSD?
@dansimpson6844
@dansimpson6844 3 жыл бұрын
CAT TAIL CUT ! - I'm glad my feline friend does not understand FORTH!
@nxzthelinuxguy5192
@nxzthelinuxguy5192 3 жыл бұрын
Always loved dt scripting tutorials. Makes me feel superman.
@MerkDolf
@MerkDolf 3 жыл бұрын
You can't buy coffee with grep, sed, or awk!
@ovopax
@ovopax 3 жыл бұрын
Not with that attitude!
@antidotejack2771
@antidotejack2771 3 жыл бұрын
Hey DT, I want to insert a Sim card in my desktop and I want to be able to connect to my ISP network and make cellphone call, send messages and get 4g LTE Internet; How can I do that?
@elclippo4182
@elclippo4182 3 жыл бұрын
You will need a 3.5“ floppy disk drive where you can put your SIM card in.
@antidotejack2771
@antidotejack2771 3 жыл бұрын
@@elclippo4182 floppy disk 🤔
@RetroSmoo
@RetroSmoo 3 жыл бұрын
I just keep sim in a phone then use usb tethering to use the internet, dunno about calling etc tho
@sys935
@sys935 3 жыл бұрын
Thats called modem usb you can make calls sms and Internet over wireless through usb modem dongle and you can also sms auto respon etc if you download and install the modem drivers
@sys935
@sys935 3 жыл бұрын
You can also use your phone to connect to adb
@ultimatebot2724
@ultimatebot2724 3 жыл бұрын
on an empty file doesn't sed return an error code
@petrlosev6611
@petrlosev6611 3 жыл бұрын
command | less -N +G
@OldieBugger
@OldieBugger 3 жыл бұрын
There are many features in GNU/Linux that make me laugh. Thanks for this one.
@elizabeththompson4424
@elizabeththompson4424 3 жыл бұрын
yeah but from different angles... lsblk then I can get the same info using findmnt but from a different direction using the disk mount directory instead of the device directory don't things present the information differently and if I don't like it I can pipe it through an awk/sed script and get it the way I want Linux gives you options unlike Windows which is their way or no way 🤪🔥💥💀
@sergey9679
@sergey9679 3 жыл бұрын
This color grading makes picture look unnatural.
@kevinwood5048
@kevinwood5048 3 жыл бұрын
Hey all of you useless-use-of-cat haters. Nothing wrong with using cat to pipe output to another command that can read from either standard input or the file. I actually find it easier to start out with cat. You can always optimize it out in a shell script later. Put that in your pipe and smoke it! 😉
@lawrencedoliveiro9104
@lawrencedoliveiro9104 3 жыл бұрын
Don’t you mean, “Put that through cat into your pipe and smoke it”?
@kashantariq9987
@kashantariq9987 3 жыл бұрын
If this isn't bloat, idk what is
@nyrization
@nyrization 3 жыл бұрын
diversity is our strength
@rahilarious
@rahilarious 3 жыл бұрын
"there are million ways to do stuff" point noted but out so many useful topics to cover it's disappointing to see u pick such topics and ramble for 10mins,not productive content. You've got awesome knowledge, setup nd platform to educate people, take advantage of it. just to name few topics i would love to see u go indepth (in case running out of content) nftables (modern iptables), tmux, gimp, LFS build, customizing own kernel ...
@007arek
@007arek 3 жыл бұрын
I don't agree with you. Learning small tools is better for scripting and more handy than the tutorial about gimp or tmux that are only useful in specific use case.
@user-he4ef9br7z
@user-he4ef9br7z 3 жыл бұрын
You can't condense complex software like tmux, iptables or LFS into youtube videos. It's just not efficient, manuals exist for a reason and experienced users know how to utilize them. Linux videos on youtube serve a different purpose.
@rahilarious
@rahilarious 3 жыл бұрын
@@user-he4ef9br7z well manual also exists for complex soft like emacs yet he recently made video on that
@nonenothingnull
@nonenothingnull 3 жыл бұрын
>rickrollrc
@gjermundification
@gjermundification 3 жыл бұрын
`exa -lT`
@mhasadi78
@mhasadi78 3 жыл бұрын
Wow your system is kinda bloated. My arch system has about 1200 packages.
@user-he4ef9br7z
@user-he4ef9br7z 3 жыл бұрын
Of course his system would be bloated, he's a youtuber. He needs to test out stuff and make videos.
@vilhelmbergse3686
@vilhelmbergse3686 3 жыл бұрын
This video was a waste of time imho. You could have talked about the reason there are many ways of doing one thing on linux, or what that entails. But no, you just drag out the length of the video and milk that adsense. 👎 from me.
@nolan412
@nolan412 3 жыл бұрын
Bottom line: it's GNU.
@rahilarious
@rahilarious 3 жыл бұрын
felt the same... it's been like that since quite few time. Distro reviews are waste too (what's the point of knowing what default apps they've installed!?)
@subterfugue
@subterfugue 3 жыл бұрын
The reason there are many ways of doing one thing in Linux is the same for why there are many ways of doing one thing in everything.
@dontdex8221
@dontdex8221 3 жыл бұрын
blkid ls blk
@starrymohannad
@starrymohannad 3 жыл бұрын
third
@DistroTube
@DistroTube 3 жыл бұрын
Confirmed!
@starrymohannad
@starrymohannad 3 жыл бұрын
@@DistroTube time repeats it self
@Penderdrill
@Penderdrill 3 жыл бұрын
SECOND!!!
@othernicksweretaken
@othernicksweretaken 3 жыл бұрын
@04:28 actually an aspirant for the useless use of cat award (according to Randal Schwartz) here ;-) instead of cat ~/.bashrc|wc -l this will do the same wc -l ~/.bashrc
@DistroTube
@DistroTube 3 жыл бұрын
Actually...'wc -l filename' and 'cat filename | wc -l' do not output the same thing. Try them both and you will see. ;)
Got Text Files Too Big To Work With? Split 'Em Up!
18:56
DistroTube
Рет қаралды 14 М.
Shell Aliases Every Linux User Needs
29:03
DistroTube
Рет қаралды 38 М.
КОНЦЕРТЫ:  2 сезон | 1 выпуск | Камызяки
46:36
ТНТ Смотри еще!
Рет қаралды 3,7 МЛН
-5+3은 뭔가요? 📚 #shorts
0:19
5 분 Tricks
Рет қаралды 13 МЛН
Essential Linux Commands - Cat, Tac and Tee
21:07
DistroTube
Рет қаралды 24 М.
The 5 Things That Taught Me The Most About Linux
18:41
DistroTube
Рет қаралды 97 М.
18 Commands That Will Change The Way You Use Linux Forever
29:50
Akamai Developer
Рет қаралды 1,3 МЛН
Beginner's Guide To The Linux Terminal
42:27
DistroTube
Рет қаралды 412 М.
Why I Can't Use Linux - My Top 3 Reasons
26:05
Tek Syndicate
Рет қаралды 148 М.
Two Powerful Command Line Utilities 'cut' And 'tr'
15:18
DistroTube
Рет қаралды 34 М.
New To Linux? Learn The Jargon!
17:40
DistroTube
Рет қаралды 50 М.
Xargs Should Be In Your Command Line Toolbag
16:24
DistroTube
Рет қаралды 103 М.
A Gentle Introduction To Linux (for Linus Tech Tips viewers)
27:58
The Painful world of Linux Ricing | A Hyprland story
13:01
typecraft
Рет қаралды 85 М.