Тёмный

Awesome Linux Tools: The bat Command 

Learn Linux TV
Подписаться 657 тыс.
Просмотров 26 тыс.
50% 1

The bat command is a clone of the cat command, but with wings! This tool can be used similarly as the cat command, but it includes additional features such as syntax highlighting, line numbers, and more! In this video, you'll see the bat command in action.
Brand New Ansible Course Available
Check out the new course on Udemy! It covers everything you need to get started with Automation.
➜ learnlinux.link/ansible
Check out the Linux Shop
In the official shop, you'll find Shirts, hats, stickers, bags and more!
➜ merch.learnlinux.tv
5% discount on LPI exam vouchers
After you finish Jay's new course, get 5% off an LPI exam voucher here:
➜ learnlinux.link/lpi-voucher
Become a Patron
Show your support for Learn Linux TV on Patreon and get access to exclusive perks!
➜ learnlinux.link/patron
Become a Channel Member
Show your support for Learn Linux TV here on RU-vid and get access to exclusive perks!
➜ learnlinux.link/member
Mastering Ubuntu Server: 4th Edition
Jay's latest book covers everything you need to know in order to master Ubuntu Server. It's available here:
➜ ubuntuserverbook.com
Linux Gear and Kits
Check out Jay's choice of hardware products, audio/video equipment, and more.
➜ learnlinux.link/amazon
Grab an awesome Pi-powered KVM
Support Learn Linux TV and grab yourself a TinyPilot KVM here:
➜ learnlinux.link/tinypilot
Note: Royalties and/or commission is earned from each of the above links
Time Codes
00:00 - Intro
01:01 - Set up your very own Linux server with Linode (sponsor)
02:07 - Comparing output from the cat command versus the bat command
04:44 - Installing bat on Ubuntu systems (batcat)
05:57 - Installing bat on Fedora
07:38 - Installing bat on enterprise Linux distributions
11:22 - Setting up an alias on Ubuntu so you can type "bat" instead of "batcat"
13:04 - Example of using the bat command to view a Python script
14:36 - Disabling paging while using the bat command
15:34 - Revealing non-printable characters with the bat command
16:23 - Using the bat command to view changes in version control
Full Courses from Learn Linux TV
• Linux Essentials Certification Workshop ➜ learnlinux.link/lpi-course
• Linux Crash Course series ➜ linux.video/cc
• Learn how to use tmux ➜ linux.video/tmux
• Learn how to use vim ➜ linux.video/vim
• Bash Scripting Series ➜ linux.video/bash
• Proxmox VE Cluster Full Course ➜ linux.video/pve
• Learn Ansible ➜ linux.video/ansible
Linux-related Podcasts
• Enterprise Linux Security ➜ enterpriselinuxsecurity.show
• The Homelab Show ➜ thehomelab.show
Learn Linux TV on the Web
• Main site ➜ www.learnlinux.tv
• Community ➜ community.learnlinux.tv
• Enterprise Linux Security Podcast ➜ enterpriselinuxsecurity.show
• The Homelab Show Podcast ➜ thehomelab.show
• Content Ethics ➜ www.learnlinux.tv/content-ethics
• Request Assistance ➜ www.learnlinux.tv/request-ass...
Disclaimer
Learn Linux TV provides technical content that will hopefully be helpful to you and teach you something new. However, this content is provided without any warranty (expressed or implied). Learn Linux TV is not responsible for any damages that may arise from any use of this content. The person viewing Learn Linux TV's content is expected to follow their best judgement and to make their best decisions while working with any related technology. Always make sure you have written permission before working with any infrastructure. Also, be sure that you're compliant with all company rules, change control procedures, and local laws.
#Linux #DevOps #LinuxTraining

Наука

Опубликовано:

 

29 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 101   
@dennisolsson3119
@dennisolsson3119 Год назад
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.
@asdf51501
@asdf51501 Год назад
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".
@Ranblv
@Ranblv Год назад
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 Год назад
It's kind of true though. Remoting into random machines is why I learned to use vi/vim and not alias commands
@SuperWolfkin
@SuperWolfkin Год назад
It certainly is how I've learned this hate certain default settings on both windows and Mac
@brandon_wallace
@brandon_wallace Год назад
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 Год назад
Wrap SSH in a way that can transmit a copy of your aliases to the remote system. Problem solved!
@rantalbott6963
@rantalbott6963 Год назад
That really is awesome, and I hadn't heard of it even though I've been using linux for decades. Thanks!
@Crackalacking_Z
@Crackalacking_Z Год назад
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 ;)
@send2gl
@send2gl Год назад
Shall install that tomorrow, very useful. Thank you.
@georgegeorge1721
@georgegeorge1721 Год назад
perfect! many additional information during the video. Especially important for Linux beginners. Thanks!
@gbo-gr-cy
@gbo-gr-cy Год назад
Great content as always! 🤘
@treyquattro
@treyquattro Год назад
BTW, cat will show line numbers too: cat -n
@Bathi666
@Bathi666 Год назад
Bat is an awesome tool. Loving it 😊
@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.
@SlideRSB
@SlideRSB Год назад
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.
@aaronperl
@aaronperl Год назад
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
@jojobobbubble5688
@jojobobbubble5688 Год назад
Seriously cool tool! Would love to see this built in to main Distro's
@brandon_wallace
@brandon_wallace Год назад
"bat" can replace "cat" permanently.
@tgirard123
@tgirard123 Год назад
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.
@donnie3897
@donnie3897 Год назад
WOw! simply fanastic tool! Love!
@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.
@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.
@TheHackysack
@TheHackysack Год назад
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. ❤
@leathernluv
@leathernluv Год назад
"What? Spell bolour with the letter K? Kolour? Oh, what a silly bunt!"
@pacquetman
@pacquetman Год назад
bat ... good to know. Thanks, Jay!
@nezarfadle7715
@nezarfadle7715 Год назад
Great video 👍👍
@mathieuberthalay21
@mathieuberthalay21 Год назад
Thank you for your video
@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).
@adjusted-bunny
@adjusted-bunny Год назад
Awesome!
@manum8170
@manum8170 Год назад
This looks rather useful, thx
@tmendoza6
@tmendoza6 Год назад
Thanks!
@refaiabdeen5943
@refaiabdeen5943 Год назад
Cheers Mate
@MatthewKressel
@MatthewKressel Год назад
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 Год назад
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.
@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...
@6bOemH2gKz
@6bOemH2gKz Год назад
this program is neat!
@shawnlewis389
@shawnlewis389 Год назад
Bro, where do you get the hexagon stickers?
@rollinkendal8130
@rollinkendal8130 Год назад
The cool apps are the ones written in assembler.
@aronwomack359
@aronwomack359 Год назад
You can use cargo to install it. Just have to add cargo to PATH.
@thingsiplay
@thingsiplay Год назад
Is that the Flux capacitor in the background?
@demanuDJ
@demanuDJ Год назад
If you want bat package for any enterprise linux its already in epel ;)
@mrcvry
@mrcvry Год назад
Fun fact: Bruce Wayne loves this command too. Thats how he came up with his alias Batman! 🦇
@hashkeeper
@hashkeeper Год назад
the beard's looking bad ass my man
@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.
Год назад
You could use Nala (instead APT) looks nicer 🙂
@rklauco
@rklauco Год назад
Have to get me some flying mamal, too...
@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.
@SiBex_ovh
@SiBex_ovh Год назад
It's more then color version of: less command
@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?
@krisbrightspirals
@krisbrightspirals Год назад
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.
@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 👍
@peterjansen4826
@peterjansen4826 Год назад
I would use wget instead of curl to download the file (archive).
@unbekannter_Nutzer
@unbekannter_Nutzer Год назад
Why, what's the benefit of using wget?
@jakemuff9407
@jakemuff9407 Год назад
how is bat different to vim with linting and plugins?
@brandon_wallace
@brandon_wallace Год назад
Vim is a text editor. Bat shows you the contents of a file and nothing more.
@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!
@yibowei9636
@yibowei9636 Год назад
How's that different from a `git diff`?
@replikvltyoutube3727
@replikvltyoutube3727 Год назад
Bat the dos and windows console scripting language?
@user-bb6qv5vi7l
@user-bb6qv5vi7l Год назад
What is it git command?
@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".
@rubberduckey5630
@rubberduckey5630 Год назад
The system is in crisis, someone needs to call the bat comMANd
@user-bb6qv5vi7l
@user-bb6qv5vi7l Год назад
What is it the bashsrc file?
@unbekannter_Nutzer
@unbekannter_Nutzer Год назад
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.
@joshuapettus6973
@joshuapettus6973 Год назад
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.
@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.
@mukto2004
@mukto2004 Год назад
For it looks like a more less command than cat
@WHORTH-TheUglyDucklingOfFORTH
Look like bat do what more / less do rather than cat... cool anyway.
@user56
@user56 Год назад
there is something wrong with the video/audio sync in your video.
@Richard-ck7sr
@Richard-ck7sr Год назад
And behaves as the Less command does - press F to make it behave like tail -f.
@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.
@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
@sergiuoanes4635
@sergiuoanes4635 Год назад
same way ripgrep should replaced grep.
@LexiLominite
@LexiLominite Год назад
Lol you can use nano instead of this ... Whats the use of batcat ?
@LexiLominite
@LexiLominite Год назад
You can even use vim
@brandon_wallace
@brandon_wallace Год назад
bat is better than cat and less.
@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.
@baptizeishere
@baptizeishere Год назад
Looks like less command on steroids.
@eddieoconnor4466
@eddieoconnor4466 Год назад
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!
@michaelplaczek9385
@michaelplaczek9385 Год назад
Bonbatonate
@gumby2241
@gumby2241 Год назад
fail, cat -n will give you line numbers, duh.
@symbioticparasite6268
@symbioticparasite6268 Год назад
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 Год назад
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.
Далее
Give the 'bat' command wings with 'bat-extras'
15:57
Просмотров 12 тыс.
Linux Crash Course - The lsof Command
23:49
Просмотров 29 тыс.
Modernize your Linux Storage with btrfs!
46:34
Просмотров 142 тыс.
Linux Command-Line Tips & Tricks: Over 15 Examples!
31:37
9 AMAZING COMMAND LINE TOOLS for Linux
17:09
Просмотров 110 тыс.
Diving into Neovim: Features, Benefits, and Basics
19:47
6 AWESOME Command Line Tools For MAC And LINUX
9:54
Просмотров 111 тыс.
ПОКУПКА ТЕЛЕФОНА С АВИТО?🤭
1:00
Asus  VivoBook Винда за 8 часов!
1:00
Просмотров 1,1 млн