Bash Terminal Cheat Sheet

Post Date:22 Feb 2026 - 11:23 AM
As a developer, the Bash Terminal is one of my most frequently used tools. It allows me to navigate projects, create files, manage folders, and run development servers efficiently.
This cheat sheet contains the most useful Bash commands I use in my daily workflow.



1. Navigation Commands

These commands help move between directories.
Command
Description
Example
pwd
Show current directory path
pwd
ls
List files and folders
ls
ls -a
Show hidden files
ls -a
cd foldername
Go into folder
cd src
cd ..
Go to parent folder
cd ..
cd ~
Go to home directory
cd ~
clear
Clear terminal screen
clear
Example:
cd Projects/my-app

2. Folder Creation Commands

Used to create project folder structures.
Command
Description
Example
mkdir foldername
Create folder
mkdir src
mkdir folder1 folder2
Create multiple folders
mkdir components utils
mkdir -p folder/subfolder
Create nested folders
mkdir -p src/components/ui
mkdir -p src/{app,modules,middlewares}
Create multiple nested folders
Creates structured folders
Example:
mkdir -p src/{controllers,models,routes}

3. File Creation Commands

Used to create files quickly.
Command
Description
Example
touch filename
Create file
touch index.js
touch file1 file2
Create multiple files
touch app.js server.js
touch folder/file
Create file inside folder
touch src/app.ts
touch folder/{a,b,c}.js
Create multiple named files
Creates 3 files
touch file{1..5}.txt
Create numbered files
Creates file1 to file5
Example:
touch src/{app.ts,server.ts}


4. File and Folder Delete Commands

Used to remove files and folders.
Command
Description
Example
rm filename
Delete file
rm app.js
rm file1 file2
Delete multiple files
rm app.js server.js
rm -r foldername
Delete folder
rm -r src
rm -rf foldername
Force delete folder
rm -rf node_modules
⚠️ Warning: rm -rf deletes permanently.

5. Move and Rename Commands

Used to organize project files.
Command
Description
Example
mv old new
Rename file
mv app.js main.js
mv oldfolder newfolder
Rename folder
mv src source
mv file folder/
Move file
mv app.js src/
mv *.js src/
Move all JS files
Move multiple files
Example:
mv server.js src/

6. File Listing Commands

Used to view folder contents.
Command
Description
ls
List files
ls -l
Detailed list
ls -a
Show hidden files
ls -la
Detailed + hidden
Example:
ls -la

7. Project Structure Creation (Real Developer Example)

Backend project structure creation:
mkdir -p src/{controllers,models,routes,middlewares}
touch src/{app.ts,server.ts}
Result:
src/
├── controllers/
├── models/
├── routes/
├── middlewares/
├── app.ts
└── server.ts

8. Useful Development Commands

These commands are commonly used in Node.js and web development.
Command
Description
npm init -y
Initialize project
npm install package
Install package
npm run dev
Run development server
node server.js
Run Node.js file
git init
Initialize Git
git add .
Add all files
git commit -m "message"
Commit changes
Example:
npm run dev

9. My Most Frequently Used Commands (Daily Workflow)

These are the commands I personally use the most:
cd project-name
ls
mkdir src
touch src/app.ts
npm install
npm run dev
git add .
git commit -m "Initial commit"