all about xargs ! (beginner - intermediate) anthony explains

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ม.ค. 2021
  • xargs is by far one of the most useful commandline tools I know -- I teach the main things you need to use it so you can look like a commandline wizard too!
    - ^D: • protip: exiting really...
    playlist: • anthony explains
    ==========
    twitch: / anthonywritescode
    dicsord: / discord
    twitter: / codewithanthony
    github: github.com/asottile
    stream github: github.com/anthonywritescode
    I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 16

  • @sadhlife
    @sadhlife 3 ปีที่แล้ว +5

    ok this was pretty cool. I just started looking into bash scripting, and I'm definitely going to look into find and xargs (and git) a lot more

  • @armpitpuncher
    @armpitpuncher 3 ปีที่แล้ว +2

    Note that the '-1' is unnecessary for ls. ls detects whether its output is going to a terminal, or if it's being piped to another program. If it's being piped to another program, like xargs, it only outputs one entry per line. So the command "ls -1 | xargs -d'
    ' --verbose -n1" does the same thing even if you remove the '-1'.

    • @anthonywritescode
      @anthonywritescode  3 ปีที่แล้ว +1

      this depends on the implementation and version of `ls` -- not all implementations behave in that way

  • @tompov227
    @tompov227 3 ปีที่แล้ว +2

    episode 200!! super cool i really like these. also what a great topic for #200 i LOVE xargs

  • @Bokbind
    @Bokbind 3 ปีที่แล้ว +1

    Dang, this is a lot of cool stuff. I've used xargs whenever I needed too, but never delved that deeply into it. This workflow is really nice.

  • @elimik31
    @elimik31 2 ปีที่แล้ว +3

    And here I was using $() subprocess substitution like a pleb, e.g. something like `echo $(ls)` or `for file in $(ls)`. xarrgs seems like the better option for most of those cases and I'll be happy to use it from now on :)

  • @example101
    @example101 3 ปีที่แล้ว +2

    xargs is indeed the Linux key to doing many bits of automation. Great code coaching.

  • @shashanksharma21
    @shashanksharma21 3 ปีที่แล้ว +1

    Another gem of a video ! Thanks !

  • @md_daud
    @md_daud ปีที่แล้ว

    thank you!

  • @theeFaris
    @theeFaris 2 ปีที่แล้ว

    Didn't agree more, find + xargs is the way to go, for long commands i usually add a tqdm at the end too.

  • @cubernetes
    @cubernetes ปีที่แล้ว

    5:29 how did you jump from EOL to that position (position before 'hello') so quickly?

  • @mister_incredible3469
    @mister_incredible3469 ปีที่แล้ว

    i still didn't get it 😥. i am very new to linux

  • @Maverick_Mad_Moiselle
    @Maverick_Mad_Moiselle 6 หลายเดือนก่อน

    What part of the quoting you "didn't do properly"?
    I keep re-reading it, but I don't understand why it manages to rename 'hello hello world' into a bak file and then tries to move a world file...

    • @anthonywritescode
      @anthonywritescode  6 หลายเดือนก่อน

      spaces in filenames got interpreted as argument separators. quoting properly prevents that

  • @walkdead94
    @walkdead94 ปีที่แล้ว

    learning xargs because I can't learn how to use variables on scripting.. hahahaha