Super User Do (admin action)
- Like changing /etc/nginx files, installing software, or restarting services require root permission.
sudo apt-get update
Change permission
# Numeric format
chmod 700 file
# Symbolic format
chmod u+x script.sh
chmod g-w file
chmod o+r file
- Owner → the user who owns the file
- Group → users in the same group
- Others → everyone else
| Number |
Permission |
| 7 |
read + write + execute (4+2+1) |
| 6 |
read + write (4+2) |
| 5 |
read + execute (4+1) |
| 4 |
read only |
| 0 |
no permission |
File related
Navigation
pwd # show current path
cd /path # absolute path
cd folder # relative path
cd .. # go up one level
cd ~ # go to home
cd - # go to previous directory 🔥 (very useful)
Listing Files
ls -l # long format
ll # alias for ls -l
ls -lh # human readable size
ls -la # include hidden files (hidden files start with .)
# Hard link (both point to the same inode, one delete, data still exist)
ln original.txt hardlink.txt
# Symbolic link (Points to file path, if original deleted → symlink breaks)
ln -s original.txt symlink.txt
# Force write
ln -f