File management

Summary

This note is a quick reference for basic file and directory handling in the shell.

Commands

  • mkdir <folder name> → create directory
  • touch file.txt → create empty file
  • cp file.txt backup.txt → copy file
  • mv file.txt archive/ → move file or rename
  • rm file.txt → remove file

Example usage

mkdir notes
touch notes/todo.txt
cp notes/todo.txt notes/todo.bak
mv notes/todo.bak notes/archive.txt
rm notes/archive.txt

Notes

  • these are the small commands you use constantly when building lab structure, copying configs, or cleaning up files
  • rm is safe in a lab only when you are sure about the current path and target