Day 18: Important Linux Commands Detailed Guide – cp, mv, nano, chmod Explained (Hindi)

🐧 Day 18: Linux Commands – Important Commands Detailed

Aaj hum sirf un commands ko detail me samjhenge jo real hacking, file handling aur system control me daily use hote hain.


🔥 1️⃣ cp Command (Copy – Bahut Important)

📌 Kya karta hai?

File ya folder ko copy karta hai.

📌 Basic Syntax:

cp source destination

📌 Example 1: File Copy

cp file1.txt file2.txt

👉 file1.txt ka duplicate file2.txt ban jayega.

📌 Example 2: Folder Copy

cp -r folder1 folder2

👉 -r ka matlab recursive (folder ke andar ka data bhi copy karega)

⚠️ Ethical hacking me reports, wordlists, payload files copy karne me ye command use hoti hai.


🔥 2️⃣ mv Command (Move & Rename – Very Important)

📌 Kya karta hai?

File ko move ya rename karta hai.

📌 Rename Example:

mv test.txt report.txt

📌 Move Example:

mv report.txt Desktop/

👉 Penetration testing me logs aur output files organize karne ke liye ye command useful hai.


🔥 3️⃣ nano Command (File Editing – Must Know)

Linux me file edit karna bahut important skill hai.

📌 File Open:

nano test.txt

Agar file exist nahi karti to create ho jayegi.

📌 Save Karne ke Liye:

Ctrl + O
Enter

📌 Exit:

Ctrl + X

👉 Real use:

  • Config file edit karna

  • Script modify karna

  • Payload edit karna


🔥 4️⃣ chmod Command (Permission Control – Extremely Important)

Ye hacking me sabse important commands me se ek hai.

Linux me 3 types ke permission hote hain:

  • Read (r = 4)

  • Write (w = 2)

  • Execute (x = 1)

📌 Numeric System:

NumberPermission
7rwx
6rw-
5r-x
4r--

📌 Example:

chmod 777 script.sh

👉 Sabko full permission mil gaya.

⚠️ Lekin 777 secure nahi hota.

Better example:

chmod 755 script.sh

👉 Owner full control, baaki read + execute.


📌 Script Run Karne Ke Liye:

chmod +x script.sh
./script.sh

👉 Hacking tools run karne me yeh bahut important hai.


🔥 5️⃣ ip a Command (Networking – Very Important)

System ka IP address dekhne ke liye:

ip a

Output me aapko milega:

inet 192.168.1.5

👉 Ye aapka local IP address hai.

Networking aur scanning me ye command daily use hoti hai.


🔥 6️⃣ cat Command (File Reading)

File ka content directly terminal me dekhne ke liye:

cat filename.txt

👉 Logs aur output check karne me helpful.


🎯 Real Practice Lab (Do This Now)

mkdir lab
cd lab
touch script.sh
nano script.sh

Isme likho:

echo "Hello Hacker"

Save karo → Exit karo

Ab:

chmod +x script.sh
./script.sh

Output:

Hello Hacker

🔥 Congratulations — aapne apni first Linux script run kar li!


🧠 Real Hacker Advice

✔ Commands ratna mat
✔ Daily practice karo
✔ Har command ka real use samjho
✔ Permissions samajhna mandatory hai

Linux strong = Ethical hacking strong.


🎯 Day 18 Final Summary

✔ cp → copy
✔ mv → move/rename
✔ nano → edit file
✔ chmod → permission control
✔ ip a → IP address
✔ cat → file content

Ye commands 100% master kar lo.


⬅ Previous Day                       

                               Next Day ➡