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

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

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

Day 3: Create, Read, Delete — Your First File Kung Fu in RHEL 9

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
Welcome back, terminal traveler! You’ve figured out where you are in the Linux file system, and now it’s time to do something exciting:

Create stuff. Break stuff. Clean it up like nothing ever happened.

Today, we’re diving into the beginner-friendly basics of file manipulation — because knowing how to read, write, and obliterate files is essential in your Linux journey (and just feels kinda powerful).

Let’s get into it.

? Table of Contents

  • touch: The File Summoner
  • cat: The Instant File Reader
  • rm: The File Eliminator
  • Bonus Round: mkdir and rmdir, The Folder Wizards
  • Try This at Home (Your Linux Mini Quest)
  • Why This Matters


touch: The File Summoner


Want to create a file out of thin air like a command-line wizard?


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



Boom. You’ve just summoned an empty file named pizza.txt. It won’t have any pineapple on it (thankfully!), but it exists.

You can even create multiple files at once:


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



Linux: Now serving your entire meal in .txt format.


cat: The Instant File Reader


Let’s say you want to peek inside a file and see what it says. Maybe it holds deep secrets. Maybe it’s just a shopping list.

If there’s content, it’ll show it. If it’s empty, Linux just shrugs silently. No drama.

Want to create and write something into a file at the same time? Try:


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



Now type your ingredients. Then hit Ctrl + D to save and escape.

Now try cat pizza.txt again. Yum.


rm: The File Eliminator


Ready to delete something with the cold efficiency of a digital assassin?


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



Gone. No recycle bin. Just poof.

Warning: rm is forever. Like, actual forever. So use it wisely.

Want to delete multiple files?


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



Your entire menu is now digital dust.


Bonus Round: mkdir and rmdir, The Folder Wizards


Create a folder (directory). Now you’ve got a cozy new place to store your files.

Remove it (but only if it’s empty):


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



If it’s not empty, Linux will scold you. ("Clean your room first!")


Try This at Home (Your Linux Mini Quest)

  • Create a directory called practice
  • Move into it
  • Create three text files
  • Add a line of text to each using cat >
  • Read them using cat
  • Delete them one by one using rm
  • Delete the practice directory with rmdir


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



Boom! You just did real Linux file operations. You are the command line now.


Why This Matters


These aren’t just “beginner commands.” These are everyday tools used by real Linux pros.

They’re the building blocks of everything — scripting, configuration, automation, debugging... it all starts with knowing how to read, write, and delete files safely and confidently.

Up Next (Day 4): We’ll explore file permissions — or as I call it, “Who gets to touch my stuff?”

Stay tuned — and until then, keep poking around your terminal. The best way to learn Linux is by doing stuff, breaking stuff, and (hopefully) learning before you wipe out your whole /home folder


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

 
Вверх Снизу