Access Files and Directories Using Terminal
Md. Aminul Islamโข
Post Date:16 Feb 2026 - 08:33 AM
As a developer, working with the terminal is an essential skill. It allows you to quickly navigate folders, create files, delete directories, and manage your project structure efficiently โ without using the mouse. In this guide, I will explain the most important terminal commands for file and folder management, with clear examples.
๏ปฟ
This works on:
Windows PowerShell
Git Bash
macOS Terminal
Linux Terminal
๐ Directory Navigation Commands
These commands help you move between folders and drives.
Command | Description | Example |
|---|---|---|
cd | Shows current directory | cd |
cd foldername | Enter a folder | cd Projects |
cd .. | Go to parent folder | cd .. |
cd / | Go to root directory | cd / |
cd ~ | Go to home directory | cd ~ |
D: | Switch drive (Windows) | D: |
Example
This moves into the Projects folder.
๐ List Files and Folders
These commands show directory contents.
Command | Description |
|---|---|
ls | Lists files and folders |
ls -a | Lists all files including hidden |
dir | Lists files (Windows) |
Example:
Output:
๐ Create Folder Commands
These commands create folders.
Command | Description |
|---|---|
mkdir foldername | Create folder |
mkdir folder1 folder2 | Create multiple folders |
mkdir -p folder/subfolder | Create nested folders |
Example
Creates:
Create Multiple Nested Folders (Professional Structure)
Creates:
This is very useful for Node.js, Next.js, and backend projects.
๐ Create File Commands
These commands create files.
Command | Description |
|---|---|
touch filename | Create file |
touch file1 file2 | Create multiple files |
touch folder/file | Create file inside folder |
Example
Creates:
Create Multiple Files
Creates:
Create Multiple Files Using Range
Creates:
๐๏ธ Delete File and Folder Commands
These commands delete files and folders.
Command | Description |
|---|---|
rm filename | Delete file |
rm file1 file2 | Delete multiple files |
rm -r foldername | Delete folder |
rm -rf foldername | Force delete folder |
Example:
Deletes:
โ ๏ธ Warning:
This permanently deletes without confirmation.
Use carefully.
โ๏ธ Rename and Move Commands
These commands rename and move files.
Command | Description |
|---|---|
mv oldname newname | Rename file |
mv file folder/ | Move file |
mv folder1 folder2 | Rename folder |
Example:
Renames file.
Example:
Moves file into src folder.
๐งน Clear Terminal
Clears terminal screen.
or (Windows)
๐ Real Developer Example (Project Setup)
๏ปฟ
Final structure:
๐ก Why Developers Use Terminal Instead of File Explorer
Faster
More efficient
Professional workflow
Better for automation
Essential for backend development
Required for Git, Node.js, Next.js, Docker
๏ปฟ