✅ So these are SAME:
cd ~
cd /Users/jumptotech
🔹 Correct usage examples
Go to home:
cd ~
Go to Desktop:
cd ~/Desktop
👉 Expands to:
cd /Users/jumptotech/Desktop
Create file in home:
touch ~/file.txt
🔹 Absolute vs Shortcut
| Type | Example | Meaning |
|---|---|---|
| Absolute | /Users/jumptotech/Desktop |
Full path |
| Shortcut | ~/Desktop |
Same, shorter |
👉 ~ ONLY works at the beginning
✅ Correct:
~/Desktop
❌ Wrong:
/Desktop/~
/Users/jumptotech/~
🔹 Real DevOps Example
When installing tools:
mv terraform ~/bin/
👉 Means:
/Users/jumptotech/bin/
👉
“~ is a shortcut for your home folder.
Don’t mix it with full paths.”
🔥 Interview answer (short)
👉
“~ represents the current user’s home directory. It is a shortcut used instead of writing the full absolute path.”
🔹 1. Navigation Commands
pwd
👉 Show current directory
pwd
ls
👉 List files and folders
ls
ls -l # detailed view
ls -a # show hidden files
cd
👉 Change directory
cd /home/ubuntu
cd .. # go back one folder
cd ~ # go to home
🔹 2. File & Directory Management
mkdir
👉 Create folder
mkdir project
touch
👉 Create empty file
touch file.txt
cp
👉 Copy files
cp file.txt backup.txt
cp -r folder1 folder2
mv
👉 Move or rename
mv file.txt newfile.txt
mv file.txt /home/ubuntu/
rm
👉 Delete files/folders
rm file.txt
rm -r folder
rm -rf folder # force delete (danger)
🔹 3. File Viewing
cat
👉 Show file content
cat file.txt
less
👉 View large file (scroll)
less file.txt
head / tail
👉 Show start/end of file
head file.txt
tail file.txt
tail -f log.txt # live logs (VERY IMPORTANT)
🔹 4. Permissions & Ownership
chmod
👉 Change permissions
chmod 777 file.txt
chmod +x script.sh
chown
👉 Change owner
sudo chown ubuntu file.txt
🔹 5. User Management
whoami
👉 Current user
whoami
sudo
👉 Run as admin
sudo apt update
🔹 6. Package Management (Ubuntu)
apt
👉 Install/update packages
sudo apt update
sudo apt install nginx
sudo apt remove nginx
🔹 7. Process & System
ps
👉 Show processes
ps aux
top
👉 Live system monitoring
top
kill
👉 Stop process
kill 1234
🔹 8. Networking
ping
👉 Check connectivity
ping google.com
curl
👉 Call API / URL
curl http://example.com
ssh
👉 Connect to server
ssh ubuntu@ip-address
🔹 9. Disk & Storage
df -h
👉 Disk usage
df -h
du -sh
👉 Folder size
du -sh *
🔹 10. Redirection & Output (VERY IMPORTANT)
echo
👉 Print text
echo "Hello"
>
👉 Overwrite file
echo "Hello" > file.txt
>>
👉 Append to file
echo "World" >> file.txt
🔹 11. Search & Text Processing
grep
👉 Search text
grep "error" log.txt
find
👉 Find files
find . -name "file.txt"
🔹 12. Archive & Compression
tar
👉 Compress/extract
tar -cvf archive.tar folder/
tar -xvf archive.tar
🔹 13. History & Help
history
👉 Show commands history
history
man
👉 Command manual
man ls
🔥 MOST IMPORTANT (Tell your students)
If they remember only these → they will survive:
ls
cd
pwd
mkdir
touch
cp
mv
rm
cat
tail -f
chmod
sudo
apt
grep
ssh
Top comments (0)