Super User Do (admin action)

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
  1. Owner → the user who owns the file
  2. Group → users in the same group
  3. 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