Linux Command: 'tee' - Watch & Log Command Output

  Рет қаралды 33,126

tutoriaLinux

tutoriaLinux

Күн бұрын

Пікірлер: 40
@tobara
@tobara 7 жыл бұрын
You might have wanted to mention the magic of "2>&1 " before piping because without this it only pipes the STDOUT but with this it pipes STDOUT and STDERR. Considering the most common use-cases, this is probably a must-know.
@MFM88832
@MFM88832 7 ай бұрын
Perfect explanation of "tee" to a tee!
@kylabutler9851
@kylabutler9851 4 жыл бұрын
Thank you so much!!!!! You explained this better to me than ANY other person or course! Thank you!!!!
@sysghost
@sysghost 7 жыл бұрын
Another tip on this command: Good to redirect the output to a process run as another user. Simple example when logged in as a normal user: This will not work: sudo echo "myawesomecomputername" > /etc/hostname This do work: echo "myawesomecomputername" | sudo tee /etc/hostname Sure there are many other ways to to this particular example. The point being is that one sometimes need to run something as a user, but need to process the output as another user. tee will help there.
@tutoriaLinux
@tutoriaLinux 7 жыл бұрын
This is a great example of real-life usage -- thanks!
@ravivemuri154
@ravivemuri154 5 жыл бұрын
Thank you!!
@DanielSMatthews
@DanielSMatthews 7 жыл бұрын
alias tea='tee -a' Unless you have the test editor "tea" installed. :-)
@OddRandomThoughts
@OddRandomThoughts 7 жыл бұрын
cool, this would be great for something like sudo watch tail -f /var/log/syslog | tee -a bla.txt if you wanted to capture just the output of a specific configuration change or problem for reviewing later. Thanks for the great tip!
@JustinC905
@JustinC905 7 жыл бұрын
Neat little video. Now I will use tee. Thanks. Man, all these videos are super useful, and great quality. Especially love the series on Python 3. Thanks a lot.
@gaithalbadarin6774
@gaithalbadarin6774 7 жыл бұрын
nice, Unix/ Linux every day something new to learn.
@fifothebot
@fifothebot 7 жыл бұрын
Another nice use case is when you want to log an interactive command, so something where you get asked stuff once in a while (username or password for example). Even though the script command might be more useful in that scenario.
@ryanhebron4287
@ryanhebron4287 7 жыл бұрын
I had no idea tee existed thanks
@Classically.Inclined
@Classically.Inclined 2 жыл бұрын
Great video! Thanks!
@AmitKumar-pl4qm
@AmitKumar-pl4qm 6 ай бұрын
Nice way to explain
@OddBallTrails
@OddBallTrails 6 жыл бұрын
Your videos deserve my subscription, thanks.
@SamSharifian
@SamSharifian 7 жыл бұрын
Hey, thanks for the cool tutorial... but can you also explain what are those green/red arrows on the left side of your prompt?! What terminal are you using? Isn't it GNOME's "terminator" by any chance?
@tutoriaLinux
@tutoriaLinux 7 жыл бұрын
That's the default prompt for zsh (the Z shell). I'm using 'oh-my-zsh' to customize it. The terminal emulator is Gnome 3 term. Have fun :-D
@QuestionTheTruth
@QuestionTheTruth 3 жыл бұрын
So, I have a raspberry pi, and on it it's only been command lines running, I now noticed that I have a full log somewhere with every commands used since like 2 years back, but I can only see one at a time, I want to be able to ... download a file which i can skim through to find what commands I used back then, because I don't remember, I have my bots on it, and that's it basically. "/
@Steeldragon92
@Steeldragon92 7 жыл бұрын
Thanks for a video, though it looks more like one of the "Hello world" one... Would love to see the use of this command along with some python/bash script, to actually show it's usefulness and convince me to use it. We need more high level stuff! :) Still thanks ;-)
@tutoriaLinux
@tutoriaLinux 7 жыл бұрын
Yep, I hear ya. There are some more advanced Linux videos coming as soon as I'm done with the Python basics course. RHCSA/RHCE is next!
@casperes0912
@casperes0912 7 жыл бұрын
Thanks for the educational material, man. It's great!
@xBIadex
@xBIadex 7 жыл бұрын
Super helpful, thanks
@zapy422
@zapy422 5 жыл бұрын
An interesting feature would also be to save the command itself.
@danydanger
@danydanger 2 жыл бұрын
Try using script command, use like this --> script /home/user/myWork.out -----> now whatever u do will be logged in this file, press ctrl+c to exit from this script output and come back to your Shell
@baleia
@baleia 7 жыл бұрын
I`m a newbie in Linux, but for this purpose of writing the output to a file I could just use nohup right!?
@tutoriaLinux
@tutoriaLinux 7 жыл бұрын
If you only wanted to write to a file, then nohup or just redirecting the output with '>>' would be fine. tee is really useful when you want to duplicate/split your output, logging it and also piping it into further commands to drill down into the data. You could, for example, log the raw output of the first command, and then also save an organized report of that same data that's been run through a little CLI pipeline. Once you know 'tee' you'll find it coming in handy quite a bit.
@jaredmeit6127
@jaredmeit6127 7 жыл бұрын
super useful. thanks!
@CarlosMendez-uo5xm
@CarlosMendez-uo5xm 7 жыл бұрын
Very cool, thanks
@micmac8171
@micmac8171 3 жыл бұрын
Thus I can write to multiple files like: date | tee f1 | tee f2 | tee f3 > f4
@modern__ninja
@modern__ninja 7 жыл бұрын
Awesome! more video like this please :3
@MartinOscarPapa
@MartinOscarPapa 7 жыл бұрын
i like it . thanks
@SadahamRanawake
@SadahamRanawake 7 жыл бұрын
thanks dude
@AnonymousAccount514
@AnonymousAccount514 7 жыл бұрын
ooph....popping those P's almost broke my speakers....do you have a governor on your mic
@tutoriaLinux
@tutoriaLinux 7 жыл бұрын
Sorry 'bout that -- experimenting with a new mic.
@amitsinghrawat_asr
@amitsinghrawat_asr 6 жыл бұрын
Thanks..🙂
@coldbluemptybottle
@coldbluemptybottle 4 жыл бұрын
f*cking WINDOWS!
@Gregorydaerr1971
@Gregorydaerr1971 5 жыл бұрын
Huh huh ... he said log.log......Hugh uhhhh Ew.
@danydanger
@danydanger 2 жыл бұрын
For whole shell output to a file Try using script command, use like this --> script /home/user/myWork.out -----> now whatever u do will be logged in this file, press "ctrl+c" to exit from this script output and come back to your Shell !!!!
@JohnnieWalkerGreen
@JohnnieWalkerGreen 2 жыл бұрын
how to tee 'tail -f /var/log/kern.log | grep XXX' ?
How to Backup and Restore a MySQL/MariaDB Database
10:18
tutoriaLinux
Рет қаралды 42 М.
Archiving and Compression on Linux - Basic tar Commands
16:11
tutoriaLinux
Рет қаралды 64 М.
啊?就这么水灵灵的穿上了?
00:18
一航1
Рет қаралды 81 МЛН
Não sabe esconder Comida
00:20
DUDU e CAROL
Рет қаралды 44 МЛН
Friends make memories together part 2  | Trà Đặng #short #bestfriend #bff #tiktok
00:18
8 Basic lsof Commands Every Sysadmin Needs to Know
15:21
tutoriaLinux
Рет қаралды 168 М.
The Linux 'script' Command: Record Your Shell Sessions
7:50
tutoriaLinux
Рет қаралды 52 М.
Linux Basics -- Scheduling Tasks with Cron
12:06
tutoriaLinux
Рет қаралды 131 М.
Everything You Need to Know About $PATH in Bash
9:31
tutoriaLinux
Рет қаралды 114 М.
Bash Scripting 3 -- Variables and Quoting
9:47
tutoriaLinux
Рет қаралды 61 М.
Linux Sysadmin Basics -- 7 -- Filesystem Layout Overview
8:36
tutoriaLinux
Рет қаралды 73 М.
Linux Sysadmin Basics 04 -- Shell Features -- Pipes and Redirection
17:47
Bash Scripting 2 -- Bash Basics
9:20
tutoriaLinux
Рет қаралды 69 М.