Skip to main content

Command Palette

Search for a command to run...

Day 7 – Mastering Linux File & Directory Management

Learn how to copy, move, rename, and delete files with Linux commands

Published
β€’2 min read
Day 7 – Mastering Linux File & Directory Management

On Day 7, I focused on one of the most essential skills in Linux: managing files and directories from the command line.

πŸ“‚ What I Practiced

Here are the commands I worked with today:

CommandDescription
mkdirCreate directories (mkdir dev, mkdir testdir{1..5})
touchCreate files (touch testfile1.txt, touch devopsfile{1..10}.txt)
cpCopy files or directories (cp devopsfile1.txt dev/, cp -r dev bakupdir/)
mvMove or rename files (mv devopsfile3.txt ops/, mv testfile1.txt testfile22.txt)
rmRemove files or directories (rm devopsfile10.txt, rm -r mobile, rm -rf *)

πŸ§ͺ Hands-On Actions

πŸ”Έ Created and organized directories: dev, ops, bakupdir, textdir
πŸ”Έ Used touch to generate multiple text files
πŸ”Έ Practiced file copying (cp), renaming and moving (mv)
πŸ”Έ Deleted individual and multiple items using rm and rm -rf


⚠️ Key Lessons

  • rm -rf * is powerful β€” use it carefully.

  • You can use brace expansion to create multiple files or dirs in one line:
    πŸ‘‰ mkdir testdir{1..5}

  • The -r and -f flags are critical when working with directories and forced deletes.


πŸ“Œ Commands Worth Remembering

mkdir dev ops bakupdir
touch devopsfile{1..10}.txt
cp devopsfile1.txt dev/
mv devopsfile3.txt ops/
cp -r dev bakupdir/
mv ops dev/
mv *.txt textdir/
rm devopsfile10.txt
rm -r mobile
rm -rf *

Recap

Today was all about Linux file management β€” a key pillar in DevOps, scripting, automation, and server maintenance. I now feel more confident using the terminal to manipulate files without relying on a GUI.

DevOps overview as a beginner

Part 7 of 50

Sharing my journey of learning DevOps as a beginner β€” covering essential tools, cloud setup, CI/CD, Docker, monitoring, and more, step by step with practical examples.

Up next

Day 8 - Logs and Text Processing in Linux

grep, cut, awk, sed, less, tail, and head in action