Filtering .log files, with cat, grep, cut, sort, and uniq

preview_player
Показать описание
Using "cat", "grep", "cut", "sort", "uniq", and "wc" ALL in one line, I show you how to filter information from a .log file, and you find out just how important strong passwords really are. This video was recorded during an online instructional session and is intended for educational purposes.
Рекомендации по теме
Комментарии
Автор

Doing this basically as a task for multiple questions in Uni. This is the only video that really made it click. Please do more tutorials, your content is fantastic!

xiMoshyx
Автор

Great introduction to the topic, a few things that i think are worth mentioning, once people have learned the commands that were being demonstrated:
If the logs your using have a variable amount of spaces between columns (to make things look nice), that can mess up using cut, to get around that you can use `sed 's/ */ /g` to replace any n spaces in a row with a single space. You can also use awk to replace the sed/cut combo, but that's a whole different topic.

uniq also has the extremely useful -c flag which will add a count of how many instances of each item there were.

And as an aside if people wanted to cut down on the number of commands used you can do things like `grep expression filepath` or `sort -u` (on a new enough system), but in the context of this video it is probably better that people learn about the existence of the stand alone utilities, which can be more versatile.

Once you're confident in using the tools mentioned in the video, but you still find that you need more granularity than the grep/grep -v combo, you can use globbing, which involves special characters that represent concepts like "the start of a line"(^) or the wildcard "any thing"(*) (for example `grep "^Hello*World"` means any line that starts with Hello, and at some point also contains World, with anything or nothing in-between/after). If that still isn't enough you might want to look into using regular expressions with grep, but they can be even harder to wrap your mind around if you've never used them before. (If you don't understand globbing or re really are just from reading this that's fine, I'm just trying to give you the right terms to Google, because once you know something's name it becomes infinitely easier to find resources on them)

yosefberger
Автор

I was searching for all command combinations in reading logs to extract an info. this video is great.

vadivelan
Автор

This video has been hugely helpful to me when parsing through log files of numerous types manually (IPtables, Netflow, SSH). Thank you very much mate.

Sparooga
Автор

This is a wonderful video. A perfect set to be learnt in order to crack interviews.

csangeetc
Автор

that was one of the most useful and simple tutorial i've ever seen

radiantmind
Автор

I am checking this video 3year after upload. The video tutorial is on point and clear.

msnraju
Автор

You are very good at Linux, hope you continue sharing your knowledge!

DarwinMatosAlvarez
Автор

Awesome tutorial on cat and grep, Thanks...

dune
Автор

Thanks.. very helpful and will be using this as a reference from now on

genghismike
Автор

Thanks! That was informative. The only thing I would have done differently is flip the order of uniq -d and sort. Less items to sort after uniq filters them out.

fredflintstone
Автор

Honestly i was looking for a long time for some good videos for linux, and sir I can tell you, your videos are gold! Thx a lot!

xiandron
Автор

Thankyou this video was exactly what i needed

messileo
Автор

Thanks a lot that's very helpfull
I would like to see more cases of analyzing the logs, to learn from you build more experience in that regard thanks

basheeral-momani
Автор

Awesome video! Please don’t stop making Linux, bash, ethical hacking related videos. Thank you. Subscribed!! 😊

ben-cber
Автор

Concept explained well in a short video.

geetabasker
Автор

great video, grep -v is quite useful. thanks for sharing this

aravind
Автор

Muy buen video, gracias por compartir, saludos desde México

gustavotobias
Автор

thanks for the amazing video
love it <3

MAX-nvyj
Автор

thank you for this helpful video for a dummy like me!

boardgamegirly