Learn These 3 Commands To Go From Terminal Noob To Power User

Sdílet
Vložit
  • čas přidán 22. 04. 2024
  • Learning the command line is important if you want to transition from "Linux noob" to "power user." And, in my opinion, there are 3 commands that are really important in this process...grep, sed, awk.
    WANT TO SUPPORT THE CHANNEL?
    💰 Patreon: / distrotube
    💳 Paypal: czcams.com/users/redirect?even...
    🛍️ Amazon: amzn.to/2RotFFi
    👕 Teespring: teespring.com/stores/distrotube
    DT ON THE WEB:
    🕸️ Website: distrotube.com/
    📁 GitLab: gitlab.com/dwt1
    🗨️ Mastodon: fosstodon.org/@distrotube
    👫 Reddit: / distrotube
    📽️ LBRY/Odysee: odysee.com/@DistroTube:2
    FREE AND OPEN SOURCE SOFTWARE THAT I USE:
    🌐 Brave Browser - brave.com/dis872
    📽️ Open Broadcaster Software: obsproject.com/
    🎬 Kdenlive: kdenlive.org
    🎨 GIMP: www.gimp.org/
    💻 VirtualBox: www.virtualbox.org/
    🗒️ Doom Emacs: github.com/hlissner/doom-emacs
    Your support is very much appreciated. Thanks, guys!
  • Věda a technologie

Komentáře • 135

  • @dezibeldani
    @dezibeldani Před 24 dny +75

    Thanks for the 68 likes in 13 days 😀- And for the heart... which I lost after editing this comment 😞
    grep..... 1:34
    sed...... 6:48
    awk... 10:42

  • @Oilzilla
    @Oilzilla Před 24 dny +16

    I'm pretty good with grep, but not so much with sed and awk. Thank you for this video. It was incredibly helpful.

    • @ForeverZer0
      @ForeverZer0 Před 24 dny +1

      Same here. I have been writing code for a nearly two decades, so using grep is pretty much just adapting regular expression syntax to grep, no different than using a different language. sed and awk are still something I need to look nearly every time, though I typically just using alternative tools or make my own when needed.

  • @user-hd8tg4em2n
    @user-hd8tg4em2n Před 24 dny +65

    You are a power user when your distro breaks and you have the knowledge of how to troubleshoot and repair it. That is when you are a power user in my opinion. Terminal commands aren't the entire picture.

    • @occultsupport
      @occultsupport Před 24 dny +10

      omg I didnt know I was a poweruser

    • @xb6xx
      @xb6xx Před 24 dny +7

      so you are a power user if your distro breaks after a kernel update, and you reboot to fix it. sound like something everyone would do, not just "power users" (just my opinion)

    • @timothyt.82
      @timothyt.82 Před 24 dny +10

      To have the knowledge to browse the web and find your solution is to be a power user.
      To figure out a solution when there is none is to be a guru.

    • @Flackon
      @Flackon Před 24 dny +2

      @@xb6xx nah, casuals just distrohop/reinstall when their distro breaks

    • @dezibeldani
      @dezibeldani Před 24 dny

      Developper and programmers can do that. I never heard of your definition of a power user.

  • @anasouardini
    @anasouardini Před 24 dny +12

    Mentioned tools:
    1:34 grep
    2:17 grep -v
    2:52 grep -A [number]
    3:15 grep -B [number]
    3:31 grep -C [number]
    3:43 grep -Irl [number]
    6:49 sed
    8:40 sed -i
    8:59 sed -n
    10:45 awk
    12:59 awk -F

    • @DistroTube
      @DistroTube  Před 24 dny +8

      NOTE: grep -Irl 'string' /path/to/directory

    • @Winnetou17
      @Winnetou17 Před 24 dny +1

      @@DistroTube If I'm not mistaken, because you liked it, he cannot edit his comment anymore (which makes sense if you think about it)

    • @DV-ml4fm
      @DV-ml4fm Před 24 dny +1

      Hi DT. Adding *sed -i.bak* will make the changes and keep a backup copy of your original file.

    • @giovannisardisco4541
      @giovannisardisco4541 Před 13 dny +2

      ​@@Winnetou17he can edit the comment and he'll lose the heart, but he can.

    • @dezibeldani
      @dezibeldani Před 11 dny +1

      @@Winnetou17 I got a heart, too. Then I edited my comment successfully --> lost the heart! 😞

  • @SeaWasp
    @SeaWasp Před 11 hodinami +1

    I'm just a minute into this. My dad had one of those O'reilly books solely on awk and sed back in the day!

  • @stefmyt5062
    @stefmyt5062 Před 24 dny +3

    Great video as always, DT! I've always struggled with awk in particular, and just felt like going out of my way to learn it would be overwhelming, but this is far more approachable than I could have ever imagined.

  • @BunnyKhatri-pd8zm
    @BunnyKhatri-pd8zm Před 24 dny +60

    real power users live in the basement

    • @subhajitmishra007
      @subhajitmishra007 Před 24 dny +5

      Underrated comment 😅

    • @robotron1236
      @robotron1236 Před 24 dny +3

      😂 I live in my Dad’s. We’re both divorced, he’s retired and I have a 5 year old, so it works out well for both of us.

    • @terrydaktyllus1320
      @terrydaktyllus1320 Před 22 dny

      No, real power users just write a script to do what they need and leave it running while they go off to the pub with their real friends, not pretend Internet ones.

    • @subhajitmishra007
      @subhajitmishra007 Před 22 dny

      @@terrydaktyllus1320 There has to be a basement somewhere in there nonetheless! 😅

    • @ultrasound1459
      @ultrasound1459 Před 21 dnem

      ​@@terrydaktyllus1320🧢📸

  • @what-about-bob
    @what-about-bob Před 24 dny +1

    Excellent video, DT! Very useful. Thanks!

  • @neelanshsharma275
    @neelanshsharma275 Před 22 dny +1

    Awesome video DT, I would like to see more videos like this on linux command line tools. Thank you 😄

  • @12Q46HPRN
    @12Q46HPRN Před 24 dny +1

    Thank you so much for this.
    It is for this type of content that I direct people to your channel.

  • @lorensims4846
    @lorensims4846 Před 24 dny +4

    The O'Reilly books are great for this sort of thing and many of them can be found online.
    In fact just about Unix Power User book will have this info.
    Of course Perl was designed to completely replace these tools and many others in one common programming language that uses much of the similar syntax you're familiar with from these tools.

  • @GNU_Linux_for_good
    @GNU_Linux_for_good Před 24 dny +1

    Thank you, Derek - that was a good one.

  • @GNU_Linux_for_good
    @GNU_Linux_for_good Před 24 dny +2

    00:34 _general regular expression print_ - yeah.. I like it..

  • @kittbennts
    @kittbennts Před 24 dny +2

    Great DT, thank you very much !

  • @TheSulross
    @TheSulross Před 16 dny +2

    what I tend to use constantly are: find, xargs, grep and sometimes awk
    occasionally tr and though it's not a simple command, but certainly use vim constantly

  • @halfsourlizard9319
    @halfsourlizard9319 Před 24 dny +4

    A really useful thing to do with `sed` is something like `/{pattern}/ s/{pattern}/{template}/g` which restricts the replacement to lines matching the first pattern ... In Ed/Vi/Vim this would be `g/{pattern}/s/{pattern}/{template}/g`.

  • @RadioTeal
    @RadioTeal Před 24 dny +1

    Great video as always. I think that along with these commands , however, I think that scripting and rudimentary programming (a basic understanding) are all part of being a "power user". As always enjoyed this video!

  • @alchiissa2231
    @alchiissa2231 Před 24 dny +1

    You're awesome!, I needed this really, and I spent a lot of time on man pages without any good understanding, and might be I'm not good at understanding the whole English idioms and vocabulary.

  • @Jnk_Nguliack
    @Jnk_Nguliack Před 24 dny

    Thank You DT .

  • @ericlindell3777
    @ericlindell3777 Před 19 dny

    Great vid!

  • @ozzie4545
    @ozzie4545 Před 23 dny +2

    Hey DT, longtime viewer over here with a suggestion. Is there any way you could provide sample files for these types of videos to make following along easier? Maybe put them on your site.

  • @knutblaise9437
    @knutblaise9437 Před 24 dny

    Great content 🎉

  • @chrissaltmarsh6777
    @chrissaltmarsh6777 Před 24 dny +8

    The etymology is fun
    Globally search for Regular Expression and Print
    Stream EDit
    And the K in awk is Kernigan.

    • @Winnetou17
      @Winnetou17 Před 24 dny

      I was searching for someone to mention this! Since DT didn't mentioned at least for sed that it comes from stream edit.
      Btw, do you know what does the "aw" in awk come from ? Awesome ? Always works ? Assembly workarounds ?

    • @chrissaltmarsh6777
      @chrissaltmarsh6777 Před 24 dny

      @@Winnetou17 Another two of the programmers. I'm so old that these are embedded. All short name as you had to type into teletypes. Sloooow.
      Ot is all very clever; Sed, ed and many others use the same regexp expressions; and you can get at them from vi. Emacs for all I know but I never coud get on with that.

    • @formica.
      @formica. Před 24 dny +2

      "The AWK Programming Language is a well-known 1988 book written by Alfred V. Aho, Brian W. Kernighan, and Peter J. Weinberger "

    • @halfsourlizard9319
      @halfsourlizard9319 Před 24 dny

      I mean g/re/p is just a schematic version of an Ed command.

  • @donpeer4477
    @donpeer4477 Před 24 dny +3

    My favorite command is TLDR. It makes short work of those overlong man pages!

    • @ChrisCox-wv7oo
      @ChrisCox-wv7oo Před 10 dny +2

      tldr is a great utility, but sometimes it's too short. I wish it had an extended mode for more complexity in typical commands

    • @donpeer4477
      @donpeer4477 Před 10 dny

      @@ChrisCox-wv7oo, This sounds like you need something like MAN's big brother. However, I have no idea what that might be or if it even exists! Perhaps DT or one of his followers can point you in the right direction?

  • @MuntazirSaad
    @MuntazirSaad Před 17 dny +2

    Commands ❌
    Programming languages ✅

  • @midjhelins8383
    @midjhelins8383 Před 23 dny +1

    excellent!

  • @MarkusHobelsberger
    @MarkusHobelsberger Před 23 dny

    I'd put cut and sort into this bunch. They leverage things you can do in a terminal by a lot.

  • @edison.s.
    @edison.s. Před 24 dny

    you are great...!
    GK Linux Addictions vs DistroTube

  • @rationalbushcraft
    @rationalbushcraft Před 20 dny

    Cool. those are the three commands I would have said had someone asked me what are the commands you should know. I can't tell you how often I have used sed and awk in scripts. Especially back in the day when installs were less refined I would create scripts to do configure the config files on installs I often did for clients.

  • @CaribouDataScience
    @CaribouDataScience Před 24 dny

    Hey DT, that grep to search for files is pretty spiffy! I use a couple of other grep flags; "-i" = ignore case, and "-E" replaces the egrep command.

  • @JoePescisAngryCousin
    @JoePescisAngryCousin Před 24 dny

    I always learn something on this channel.

  • @0stre
    @0stre Před 24 dny

    I was doing some crazy conky scripts with those commands, they are awesome!

  • @davidparker2173
    @davidparker2173 Před 24 dny

    I need to get into the command line. I have lazily put it off, but now I need to exercise, and to gain some acuity. I need to get into some good entry level tutorials. I wonder what teaching would connect with me best. "Seek, and you will find", huh? This was a too advanced for me, but I got tiny amounts of it, and it made my brain work.

  • @vincent4070
    @vincent4070 Před 18 dny

    My personal top 3 (or 4 if 'pipe' is count)
    for, sed, pipe, xargs.

  • @thequietone2510
    @thequietone2510 Před 19 dny

    As a Linux tourist of 20 years, I often feel bad for the more typical Linux users who sometimes need to write software: because they always seem to think I'll find their skillset really interesting and useful. These 3 commands grep sed and awk may be abstract and powerful but I've never had any use for them. I may have used the first two, but only when I've been copying and pasting commands from forums to try and make the graphics driver work. And that isn't really the same as using them.

  • @Milena-ix5mq
    @Milena-ix5mq Před 19 dny

    Weird request, but could you Please make a video about a terminal DE? The entire process of booting up a system and then not using a graphical environment is so weird to me, I cannot wrap my head around it, as if it is an incomplete installation, but then again you have everything you need, so its a very interesting topic for me.
    Thank you!

  • @nwo_akil
    @nwo_akil Před 24 dny +2

    I caught the basics of awk command. Now I have to practice to learn more. What a shame on me to work with linux for 20 years but avoid the awk...

    • @rocketsurgeon1349
      @rocketsurgeon1349 Před 24 dny +1

      Never learned more than the basics in this video, mostly because if i needed something more advanced it was easier to use a few lines of perl/ruby/python instead.

    • @fakecubed
      @fakecubed Před 4 dny +1

      awk is something I learned, but never have a reason to use.

  • @manee427
    @manee427 Před 24 dny

    perfect

  • @Abdo70t
    @Abdo70t Před 13 dny

    beautiful ♥♥

  • @locatemarbles
    @locatemarbles Před 24 dny +1

    Indeed, that would be my definition of a Linux power user too. Somebody that starts bash scripting. But before the regular user starts bash scripting he goes through a stage of utilizing commandline core utils, such as grep, sed and awk.

    • @007arek
      @007arek Před 13 dny +1

      You don't need to use bash instead of it you can a proper programming language like use lua or python.

    • @locatemarbles
      @locatemarbles Před 10 dny

      @@007arek , Wrong. At that point you have crossed the line from a power user to a programmer. So why learn python at all? Makes more sense to learn C at that point. Bash and C is all you need.

    • @007arek
      @007arek Před 10 dny +1

      @@locatemarbles this line exists only in your mind.
      The lat sentence is a great joke.

  • @TrebleKnight
    @TrebleKnight Před 24 dny

    I can see grep saving you a little time from using catfish, or your file managers search function, but for sid I don't see why I wouldn't just use my text editors built in find and replace tool. Maybe it's good if you use vim or nano, but that seems kinda niche.

    • @pkz420
      @pkz420 Před 24 dny +2

      It wouldn't really be of much use for you, in those situations.
      Grep was designed for use from a terminal, and able to be automated by scripts. It can do the things you say, but it was never optimized for that. The built in search was, so it will be more convenient for you.
      But grep is not limited to inside an editor. It can be used on files, generated text output, or any other source. It also has a lot of advanced capabilities that make it ideal for managing data, in bulk, using inside scripts, and can be used from the command line without having to load an editor.

  • @kokizzu
    @kokizzu Před 23 dny

    for sed i prefer using pipe (|) character instead of slash (/), too bad default mac sed is not supported, have to update

  • @formica.
    @formica. Před 24 dny +1

    awk is my favorite language, and I programmed in assy, c, perl, php, python, c++, java, js. Awk one liners are ok, I prefer to put the commands in a file, so I can run it again in the future. And so I remember how to do something, I have the history. Get the book.

    • @halfsourlizard9319
      @halfsourlizard9319 Před 24 dny +1

      That certainly is an interesting set of ... unfortunate languages.

    • @formica.
      @formica. Před 24 dny

      @@halfsourlizard9319 Ha! I guess I learned c starting around 1987, after programming intel, Motorola, and Rockwell microprocessors in assembly. I also forgot - basic, lisp, ruby.
      What are some fortunate languages that you know? It's fun, I should learn more.

    • @mikechappell4156
      @mikechappell4156 Před 23 dny +2

      @@formica. 1987 was when I picked up C as well. It was pretty easy coming from Pascal. Touched on ForTran too. While ForTran was never a preferred language for me some of the syntax for implied DO(?) loops was kind of cool. (Only had half a semester around 37 years ago, so it's a bit foggy.) I guess you took what ever shortcuts you could when the language assumed you were developing on punch cards.

    • @anon8510
      @anon8510 Před 23 dny

      @@halfsourlizard9319 a very respectful set of languages, wym?

    • @fakecubed
      @fakecubed Před 4 dny +1

      @@halfsourlizard9319 LOL yeah, that is slightly cursed.
      I have a pretty cursed set of languages in my history, as well.

  • @peterbutler5597
    @peterbutler5597 Před 24 dny

    I use grep in a big block of code to index all the function names - grep -n "function" test.php - then I know what line to go to in vim

  • @bigo72
    @bigo72 Před 24 dny +1

    grep Irl doesn't work for me on Arch, DT. It says my string is not a file or directory and that the directory I call is a directory .... strange output.

    • @lumnetto
      @lumnetto Před 24 dny +2

      It's "grep -Irl", not "grep Irl".
      You're telling grep to search for the string "Irl" instead of passing these letters as options to the program.

  • @VexisMorlock
    @VexisMorlock Před 24 dny

    U could easily include cut in this

  • @kokizzu
    @kokizzu Před 23 dny +1

    feedback, please type the command on top, not below, since bottom part usually covered by youtube's progress bar and buttons

    • @terrydaktyllus1320
      @terrydaktyllus1320 Před 22 dny

      Have you not considered just moving your mouse? Or calling your mum upstairs and get her to move it for you whilst bringing you up your hot milk for bedtime?

    • @kokizzu
      @kokizzu Před 22 dny +1

      @@terrydaktyllus1320 when on fullscreen mode, moving mouse is the cause of those progress bar and buttons showing

    • @terrydaktyllus1320
      @terrydaktyllus1320 Před 22 dny

      @@kokizzu Well, then get your mother to stop you moving your mouse when she comes up with your bedtime milk.

    • @kokizzu
      @kokizzu Před 22 dny +1

      @@terrydaktyllus1320 who hurt you man XD

    • @terrydaktyllus1320
      @terrydaktyllus1320 Před 22 dny

      @@kokizzu Stop projecting the emotions that you want to onto my comment because that's called "cancelling" and there's a word for people that indulge in cancelling and I am sure you're not one of those, sonny.
      Now run along, mind how you go and stay away from sharp scissors.
      Discussion closed.

  • @twentyrothmans7308
    @twentyrothmans7308 Před 24 dny +1

    I'd hardly say power user with grep and sed - they're everyday tools.
    Awk's really big, and needs a lot more love and attention to understand.
    That said, I had forgotten about the grep -I flag, thank you 🙂

    • @halfsourlizard9319
      @halfsourlizard9319 Před 24 dny

      Pretty sure that these days 'is capable of using a TTY' constitutes being a 'power user' ... all the kiddies mousing through their GUI bloatware.

    • @pkz420
      @pkz420 Před 24 dny +2

      If they are "everyday tools" to you, then by todays standards, you are a power user.

    • @twentyrothmans7308
      @twentyrothmans7308 Před 24 dny

      @@pkz420 S'truth, that's scary.

  • @hexisXz
    @hexisXz Před 24 dny +1

    I like your glasses

  • @xade8381
    @xade8381 Před 24 dny +1

    awk is enough

  • @leloupization
    @leloupization Před 24 dny +2

    What is the step between noob and power user? Power noob ? I'm that one.

    • @robotron1236
      @robotron1236 Před 24 dny

      After about 6 months of using only Linux (I use arch btw 😂) and studying hacking, I’d have to say that’s the best description for where I’m at too.

  • @glucid4222
    @glucid4222 Před 21 dnem

    But here's the thing, how many Linux users really want to be or need to be a power user? By the measures set out here alone, I'm definitely a newbie. But for my own needs, knowing how to prepare & partition the PC drive to install a distro, knowing how to install the distro, install various apps and updating them, do the occasional clean up, set out & retrieve backups, as well as knowing how to work with files in Linux, is about as much as I know, and most likely that would also be enough for 95 percent of Linux users out there. I ran away from Windows five years ago because it was getting clunky, resource & money greedy, and just outright pitiful. Linux has come a long way to be good enough for about 95 percent of PC users like myself. Anything beyond that, and you're either getting paid to be in it, or you own a lot of gear that needs to run Linux.

  • @michgingras
    @michgingras Před 18 dny

    your workflow ? maybe ... but if i need your videos i am not working in linux i guaranty you , so basicaly workflow only mean i feel more important that i am

  • @dagensekopunktcom
    @dagensekopunktcom Před 24 dny

    Do you see yourself as a "power user"?

  • @anasouardini
    @anasouardini Před 24 dny

    Man, use the `b` and `e` when you move around the prompt line using vim-mode.

    • @Winnetou17
      @Winnetou17 Před 24 dny +2

      For the general public, it's easier to follow like DT did it.

    • @anasouardini
      @anasouardini Před 23 dny

      @@Winnetou17
      - It won't affect the public
      - he already has vim-mode

  • @Billinous
    @Billinous Před 18 dny

    A power user is someone that uses more than 80% of the operating systems advanced tools.
    Its not relegated to the Terminal.

    • @007arek
      @007arek Před 13 dny +1

      It's almost impossible

  • @magnusphilosophus506
    @magnusphilosophus506 Před 24 dny

    I'd just use perl oneliners instead of all of this

  • @alanwood4968
    @alanwood4968 Před 11 dny

    How about something lighter "Nooby nooby noob , ahh nooby nooby noob, noo nooby. lol

  • @user-zu6wg9wt8m
    @user-zu6wg9wt8m Před 24 dny +1

    i use arch btw

  • @user-kn4wt
    @user-kn4wt Před 24 dny +3

    DT is not a power user imo

    • @robotron1236
      @robotron1236 Před 24 dny +1

      How so? That’s a serious question. Considering I’d like to be one eventually myself.

    • @user-kn4wt
      @user-kn4wt Před 23 dny +1

      @@robotron1236 power users don't switch distros every 2 months, switch window tiling manager every 3 weeks, and customize their bashrc everyday... they actually do useful stuff. what has DT actually achieved or built?

    • @whereistheline8964
      @whereistheline8964 Před 23 dny

      He teached a lot of basics to a lot of people. I learned a lot from dt when I started to learn about Linux and Open Source

  • @Ou8y2k2
    @Ou8y2k2 Před 23 dny

    Real power users break their distro, and instead of learning grep, sed, awk, sudo, and 45,692,514,545,487,699 other commands, go back to Windows. Because we're no longer using *nix in the 80s.

  • @terrydaktyllus1320
    @terrydaktyllus1320 Před 24 dny

    Modern millennial and genx-er poseurs with their Steam Decks thinking that makes them Linux experts all of a sudden also simultaneously whine about having to use the Linux command line - the core point being that even three "words you have to type in at a shell prompt" will be something they are unwilling to do - unless the likes of you or I go round to their homes and type it in for them, whilst no doubt having to massage their tootsies and being accused of being "elitist" or a "gatekeeper" because nothing bad in their lives is ever their fault.

    • @pkz420
      @pkz420 Před 24 dny

      I'm a "genx-er poseurs". I bet everything that I was using Linux before you.
      I was there from the start. When Linus was still a student.
      I may have helped write some of the HOWTOs and info pages you learned from, and contributed some of the code you use. The only thing you do better is acting like an "elitist gatekeeper".
      We've always welcomed everyone, new or old, to the community. You do not speak for, or represent, the og community.
      And I value a noob that is eager to learn, over a dick that just wants to posture and tell us how much better he is

  • @unbekannter_Nutzer
    @unbekannter_Nutzer Před 19 dny +1

    Real power users don't use apostrophs or quoting, when it is superfluous. ;)
    `grep Dereck .bashrc` is sufficient. If you need to mask blanks, then
    `grep "Bo Derek" .bashrc` would be sufficient. To search for expressions which would otherwise be interpreted by the shell, you need apostrophs.
    `grep $USER .bashrc` searches for a dereferencing of `$USER`, not for the dereferenced value.

  • @halfsourlizard9319
    @halfsourlizard9319 Před 24 dny

    s/Derek/Derk/g This is the way!

    • @Winnetou17
      @Winnetou17 Před 24 dny

      Then just pipe into sed 's/D/J/g' and all will be fine 😁

    • @halfsourlizard9319
      @halfsourlizard9319 Před 24 dny

      @@Winnetou17 might as well use `tr` in that case!