Awesome Linux Tools: The bat Command

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ม.ค. 2025

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

  • @Ranblv
    @Ranblv ปีที่แล้ว +17

    when I did the RHCE course the instructor kept telling us to try to avoid aliases and custom commands cause they will spoil us and when we connect to clients we won't have them. I lasted that way for one year 🙂

    • @hammerheadcorvette4
      @hammerheadcorvette4 ปีที่แล้ว +6

      It's kind of true though. Remoting into random machines is why I learned to use vi/vim and not alias commands

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

      It certainly is how I've learned this hate certain default settings on both windows and Mac

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

      Aliases and custom function are great. They can really speed up your workflow.

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

      @@brandon_wallace Except when you are remoting into some machines that don't have your custom edits. . .

    • @rainmannoodles
      @rainmannoodles ปีที่แล้ว +4

      Wrap SSH in a way that can transmit a copy of your aliases to the remote system. Problem solved!

  • @dennisolsson3119
    @dennisolsson3119 ปีที่แล้ว +6

    Nice tool, but I think this is more of a replacement to "less" than cat.
    Thanks for the tip!

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

      I remember from my Linux books when they said "less is more"

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

      With bat you no longer need less or cat.

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

    That really is awesome, and I hadn't heard of it even though I've been using linux for decades. Thanks!

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

    Nice! I love stuff like this, where we have linux videos that go beyond "which distro should I use and how should I install and theme it".

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

    Part of the charm of these videos is to witness the office evolving a little bit in the background with every new video, the command is neat too, I guess ;)

  • @Bathi666
    @Bathi666 ปีที่แล้ว +4

    Bat is an awesome tool. Loving it 😊

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

    perfect!
    many additional information during the video. Especially important for Linux beginners.
    Thanks!

  • @cmdr.glenel9274
    @cmdr.glenel9274 ปีที่แล้ว

    bat command seems like improvement of cat, it's probably what you are use to. I use vim most of time, it's very handy when you want to edit something without starting other application to do so.

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

    I always forget about the bat command, even after I install it. And then I get reminded of it again and rediscover how awesome it is all over again.

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

      You always could aliasing cat to bat 😉

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

      @@airbeast5671 yeah, I'll probably do that... I think I always assumed there was some reason the executable wasn't called bat, so I figured an alias would interfere somehow.... But since Jay suggested it, I assume there won't be a problem

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

    Thanks!

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

    At the beginning of the video, you mentioned "line numbers" as one of the features of bat that cat doesn't do. FYI, the "-n" flag for cat will print line numbers.

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

    I'll write you a comment just for the algorithm. this is amazing. already implemented with alias, theme and all. can't wait to be hella surprised when using cat next time bc I'm most likely gonna forget about all this until then.

  • @jojobobbubble5688
    @jojobobbubble5688 ปีที่แล้ว +9

    Seriously cool tool! Would love to see this built in to main Distro's

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

      "bat" can replace "cat" permanently.

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

    BTW, cat will show line numbers too: cat -n

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

    I've loved `bat` ever since the first time I heard about it. It's nearly the first thing I install on new machines. It's just far too convenient. ❤

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

    Shall install that tomorrow, very useful. Thank you.

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

    FANTASTIC!!!! I love how bat colorizes and allows the arrow keys. This kinda reminds me of why I switched from 'apt' to 'nala'. I would love to see your opinion on nala and if you liked it maybe a video. I just think that adding color, organization and a little more visual cuing to the command line will do nothing but help young players to get comfortable faster.

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

    bat ... good to know. Thanks, Jay!

  • @gbo-gr-cy
    @gbo-gr-cy ปีที่แล้ว +1

    Great content as always! 🤘

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

    This looks rather useful, thx

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

    WOw! simply fanastic tool! Love!

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

    "What? Spell bolour with the letter K? Kolour? Oh, what a silly bunt!"

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

    Thanks jay for that idea. I been using bat on my Sparky Linux Semi-rolling KDE distro.
    Loving Debian testing especially Sparky Linux Semi-rolling. And I follow all the instructions that you told us in the video. It works just fine.
    If ever try reviewing Debian testing or Sparky Linux Semi-Rolling. People like Semi-Rolling Debian release distro including Sparky Linux.

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

    Bro, where do you get the hexagon stickers?

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

    Does not work on an updated Linux Mint 20. Decorations are there but no text. Is this open source? Note that I did not reboot after the install.

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

    I installed it on Debian Bullseye and I can't get the line numbers to appear. -n doesn't work.🤕
    What I have noticed is I did a copy and and paste and noticed the line numbers ARE there I just can't see them on the terminal. If I look really closely I can JUST see them. Any ideas?

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

    From chatGPT
    "Is Rust language a good alternative to write new GNU tools, replacing the current ones?
    Yes, Rust is a good alternative to write new GNU tools. It offers benefits such as memory safety, improved performance, and a modern syntax that can make it easier to maintain and extend existing tools. However, it ultimately depends on the specific use case and the preferences of the development team, as some projects may still prefer to use C or other languages."
    Interesting...

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

    Is that the Flux capacitor in the background?

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

    Not sure I see the point. The power of cat is to be used with piping output from one or multiple files to other commands, and then format that output how you need for some function or another. Adding in line numbers kinda messes up the input a bit. Anyway if I ever needed to open and read a file I use vim, which can do a heck of a lot more than what batcat is offering.

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

      Yet another example of someone creating something new, which doesn't do much of anything that didn't already exist. "But this was written in rust"!
      Line numbers, cat.
      Paging, less
      + Lines added, diff
      Total fail as a replacement for cat, adding line numbers and colors blows up the data stream. If you want paging use less, the benefit of cat is it doesn't page - use the right tool for a given need. Not sure I've ever needed line numbers when parsing a log file, more interested in searching for the issue, so use grep, or awk.

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

    Very cool command. Does bat share the same command line parameters as cat, so that aliasing is possible? I wonder, would aliasing cat to bat break scripts that rely on the original cat?

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

      Yes, it would. It's probably possible to avoid breakage if you aliased it with parameters, like the way "ll" is aliased to "ls -l", but why? It might make sense to alias "less" to it, since they're similar.

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

    Hi, I am trying to install bat on raspberry pi 3 but see an error E: Unable to locate package bat

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

    Executing sudo batcat /var/log/syslog on my Raspberry Pi only shows line numbers with empty lines.

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

    Thank you for your video

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

    Is there a benefit to running bat instead of opening the file in vim?

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

      Well, there's not needing to learn vim. 😎 You'd be happier in vim because you could use the searching and navigating, but I wouldn't because I don't know them.

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

      Yes, you needn't exit vim (which many people struggle to do ;) ), you can't change the content by accident, ... - there are drawbacks too, like you need to exit the pager, if the content is longer than a screen length, you can't change the content of the file, ... ;)

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

      @@unbekannter_Nutzer If you are worried about changing the file, just use view instead. It's essentially vim in read-only mode. I use it all the time.

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

    Ahh! I found bat a while back when you had to install it using Rust's "cargo" package manager. That's great it has distro packages now. :D I didn't know about the git integration either, that's awesome! Other handy Rust tools I use on occasion include exa (ls replacement), hexyl (hex viewer), and miu (CLI image previews).

  • @6bOemH2gKz
    @6bOemH2gKz ปีที่แล้ว

    this program is neat!

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

    Bat the dos and windows console scripting language?

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

    Great video 👍👍

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

    Fun fact: Bruce Wayne loves this command too. Thats how he came up with his alias Batman! 🦇

  • @try-that
    @try-that ปีที่แล้ว

    I installed bat via pop_os using apt install bat, but when you come to run it you need to use 'batcat' :( Which seems really stupid!

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

    If you want bat package for any enterprise linux its already in epel ;)

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

    You can use cargo to install it. Just have to add cargo to PATH.

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

    the beard's looking bad ass my man

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

    Awesome vid Jay1.....but I have one of those "Totally-Unreleated-To-The-Video-Per-Se" questions.
    see....I have seen countless videos one after the other stating how "lightning fast" Arch Linux is right?...but when you went to install the bat application on AlmaLinux it literally took less than a few seconds...so exactly how much "faster" can Arch possibly be?...or am I missing something? Me and a few of the Linux faithful in my neighborhood are curious...
    I Use Fedora BTW.
    LoL!

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

    how is bat different to vim with linting and plugins?

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

      Vim is a text editor. Bat shows you the contents of a file and nothing more.

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

    The cool apps are the ones written in assembler.

  • @АнгелИнокентий
    @АнгелИнокентий ปีที่แล้ว

    What is it git command?

  • @АнгелИнокентий
    @АнгелИнокентий ปีที่แล้ว

    What is it the bashsrc file?

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

      It's the .bashrc file (note the leading dot, which hides the file for some tools/setting/commands) and it's your personal configuration file for the bash.

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

    How's that different from a `git diff`?

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

    I would use wget instead of curl to download the file (archive).

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

    That's very cool, thanks. However, I installed the "bat" command on my debian distro but the syntax is not in colours!

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

      That’s because you’re using a monochrome monitor 👍

  • @adjusted-bunny
    @adjusted-bunny ปีที่แล้ว +1

    Awesome!

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

    Cheers Mate

  •  ปีที่แล้ว

    You could use Nala (instead APT) looks nicer 🙂

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

    Have to get me some flying mamal, too...

  • @LukeKendall-author
    @LukeKendall-author ปีที่แล้ว

    It's sad to see such a total misunderstanding of the fundamental Unix philosophy.
    If you want syntax highlighting, use a tool that does that (vim maybe, or bat, or something that would also allow you to convert it to a pdf), but don't consider it a replacement for cat.

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

    there is something wrong with the video/audio sync in your video.

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

    It's more then color version of: less command

  • @oraz.
    @oraz. ปีที่แล้ว

    Bat doesn't work. It crops the output even after resizing the terminal. The trend of saying "written in rust" is a red flag it seems.

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

    The system is in crisis, someone needs to call the bat comMANd

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

    Lol you can use nano instead of this ... Whats the use of batcat ?

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

    It looks like less command but in better looks

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

      Totally agree, it's not a replacement for cat...it should have been called bless "Better less".

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

    Cat is cool
    Bat id better
    ChatGpt is the phat Cat in the Hat with a matte bat chasing after rats

  • @Richard-ck7sr
    @Richard-ck7sr ปีที่แล้ว

    And behaves as the Less command does - press F to make it behave like tail -f.

  • @WHORTH-TheUglyDucklingOfFORTH
    @WHORTH-TheUglyDucklingOfFORTH ปีที่แล้ว

    Look like bat do what more / less do rather than cat... cool anyway.

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

    Only playing "Devil's advocate" here, but `cat` is also handy that you can enter `tac` (`cat backwards) and get a reverse output too.
    But `bat` does look handy.
    Oh, and following on from my `cat` mention: It would be funny/punny if rather than calling it `bat` it was called `dog`. Ok, sorry. Poor effort at humor.

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

      And combining your statements (and to add another poor attempt at humor): to get reverse output with the proposed "dog", you would have the "god" command to do everything backwards, which seems legit.

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

    same way ripgrep should replaced grep.

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

    bat is better than cat and less.

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

    Looks like less command on steroids.

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

    For it looks like a more less command than cat

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

    fail, cat -n will give you line numbers, duh.

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

    Bonbatonate

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

    Sudo batcat thisvideo

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

    Why wouldn't I just create a link to in
    /usr/bin/bat
    pointing to /usr/bin/batcat
    Instead of the alias?

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

      a) You can add your favorite flags (like --pager=NEVER, or whatever it was) to an alias.
      b) It's more easy to carry your .bashrc-file with you on an USB-stick, than to replicate links on different systems.