VehiclesFashionRecipesBlogsHuntTravelsSportFunHandmadeITEducation
Mini-Games
x

x
zakruti.com » IT - Software » IT, programs, coding
Essential Linux Commands - Cat, Tac and Tee DistroTube

Essential Linux Commands - Cat, Tac and Tee DistroTube

FBTwitterReddit

video description

Rating: 4.0; Vote: 1
Essential Linux Commands - Cat, Tac and Tee DistroTube In this video, I will discuss three of the basic command line utilities: cat, tac and tee. These commands are useful for printing the contents of files to standard output and concatenating files. Very handy tools to know whether using the shell interactively or scripting. - https://distro.tube/man-org/man1/cat.1.html - cat - https://distro.tube/man-org/man1/tac.1.html - tac - https://distro.tube/man-org/man1/tee.1.html - tee
Date: 2022-03-30

Comments and reviews: 10


The tee content is missing a really cool addition that I've only needed once so far. Using process substitution you can split pipes to multiple commands (ksh/bash/zsh):
Uname - tee >(cowsay) >(grep a) ... >(Command n) - grep b
All the commands will be run with the same input
Think you can do the same process substitution in fish by just doing:
command 1 - tee (command 2) (command 3)

reply

You explained > and >>, but not -. Of the three, I would think that's the one that most needs explaining to beginners. Also, I didn't know command-line arguments really count as stdin, I thought that was only when programs ask for input while running (the way a newbie's second program after hello world, the one that echoes your name back at you, would typically work).
reply

First of all, it has to be mentioned that the kind of redirection with file descriptors you show, only applies to those shells, who have mainly inherited from the Bourne shell, while other shells might have other notations for that.
The other points:
No, -cat 0

reply

Looks like you have a much more stronger and complicated password on your main machine there. Excellent video! I love these shell command videos. This one was really interesting. Thanks!
reply

Hay DT, please review NEWM. It's a new type of Window Manager which is supposedly designed specifically for laptops. I haven't seen any reviews on it. Would appreciate a lot. Thanks!
reply

Tac was useful for me because I wanted to print N lines before a match, and the way I found to do it is
-tac - awk (print N lines after a match) - tac-

reply

cat is also useful to write/burn isos to drives, so it's a more efficient and clean alternative to dd or the other gui utilities out there
reply

Tac & Tee sound quite like the little programs I've written for some specific use, often a single use. Or sometimes I've used them twice.
reply

I actually had the very last problem recently. I just sledgehammered it with su, but the tee solution would have been much more elegant :)
reply

15:02 now open that file using vim or nano.
You will see all of thaf weird -/003- escapes that got interepted by the shell.

reply
Add a review, comment






Other channel videos