• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

Day 6 – “Where Did It Go?!” | Mastering the find, head, tail, and wc Commands in RHEL 9

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
Let me paint you a picture.

You're sitting at your terminal. You know you downloaded that important file somewhere. Maybe in Downloads. Or Documents. Or... was it in the mysterious /tmp?

You try clicking around, but there’s no clicky. Just blinking text. Panic sets in.

But wait — you have a superpower now. It’s called the command line, and today, we’re wielding four little heroes who will help you find what’s missing, peek inside files, and count like a digital mathematician.

? Table of Contents

  • Meet the Squad
  • find: The Detective
  • head: The Chiller
  • tail: The Gossip
  • wc: The Bean Counter
  • Try This: Your Mini Linux Mission
  • Why This Stuff Matters


Meet the Squad



find: The Detective



find is like the Sherlock Holmes of the Linux terminal. You give it a clue — a filename, a directory, maybe a wildcard — and it scours your system like a caffeine-powered bloodhound.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



That says: “Dear Linux, go search everywhere inside /home for a file called notes.txt.” It's fast, it’s sharp, and it doesn’t stop until it gets results.

Bonus: It’s also great for hunting down lost dignity after a failed rm command.


head: The Chiller


You know when you only want to read the first few pages of a book to see if it’s worth your time? That’s what head does for files.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



It gently shows you the top 10 lines of the file without forcing you to scroll for days. Classy, right?

Need more or fewer lines?


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



Just 2 lines. Enough to understand the shopping list.


tail: The Gossip


tail is the nosy neighbour who only cares about what’s happening at the end. Perfect for checking logs or watching new info appear in real time.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



Even better:


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



That -f means “follow” — as in, “I’ll sit here and live-stream this log file like it’s my Netflix.”


wc: The Bean Counter


wc stands for word count, but it's secretly a stats machine. It can tell you how many lines, words, and characters are in a file.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



Need just the line count?


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



This is perfect for flexing: “I wrote 894 lines of config today.” Boom. Productivity.


Try This: Your Mini Linux Mission

  1. Create a test file
  2. Use head to view the first 3 lines
  3. Use tail to check the last 2 lines
  4. Use wc -l to count how many lines total
  5. Misplace it and use find to save the day


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.




Why This Stuff Matters


Each of these commands does a simple job — but together, they make you a smarter, faster Linux user.

Think of them like the tools in Batman’s utility belt. Alone? Useful. Together? Unstoppable.

And remember: reading tutorials is great — but typing the commands, messing around, and breaking stuff a little is how you really learn. File-fu takes practice.

So go explore, poke around, count some words, and tail some logs. Your terminal superpowers are growing by the day.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу