File & Directory Manipulation
Creating, copying, renaming, and deleting files and directories are foundational skills for any Linux user. Learn how to manage the Virtual File System cleanly.
Lesson Objectives
4 Steps1Step 1: Create a Dedicated Lab Directory
Run `mkdir -p lab/configs` to create a parent and subfolder in one command.
2Step 2: Create a Shell Script File
Run `echo "echo hello linux" > lab/test.sh` to create and write content to a file.
3Step 3: Verify Creation & Inspect Content
Run `cat lab/test.sh` to confirm the script content was written properly.
4Step 4: Copy the File to Backup
Run `cp lab/test.sh lab/configs/test.bak` and check with `ls -l lab/configs`.
💡 Pro Tip:
Always use `mkdir -p` when creating nested directory structures to avoid "No such file or directory" errors.
bash — terminal
AST Sandbox (Free)