You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cd / # navigato to the start of the harddiskcd /usr/share # examplecd savolla # no absolute path using tab tabcd ./lib # . means current directory# navigating to home 3 wayscd /home/savolla #cd~/savolla # if you are lazycd# if you are ultra lazycd ../ # go one level up. go backwardcd ../../../etc # go 3 levels back and press tab tab
summary
pwd# prints current directorycd ../ # goes backwardcd ./ # means current directorycd / # means go to the very beginning like C:\\ in windows
ls
what’s the point if we just navigate accross the file system but can’t do
anything?
ls # lists content of the current directory
ls -l # lists more information
ls -l ~/Documents # list directories without leaving the current directory
lec 2 (file permissions)
edit one file from /etc/hostname
show that they can’t change the file
ls -l /etc/hostname to show the privilages
tell them about root user
sudo
sudo <command># runs as super user
sudo vim /etc/hostname
whoami
whoami # shows the current user
su
what if we don’t want to use sudo everytime
su root # switch to the super user (root)
whoami # show who am i
vim /etc/hostname
su nick # switch back to my user account way 1exit# switch back to my user account way 2