Linux Commands
SU / SUDO
-Some commands required elevated rights
Is
-For long output pipe through more
Is-1 | more (by page) use 9 or ctrl-c to exit
grep
-grep PATTERN [file]
>grep failed auth.log
cd
-cd
>cd/var/log
shutdown
-ctrl-c to cancel
pwd vs passwd
mv
-mv SOURCE DEST
>mv first.txt second.txt
cp
-cp SOURCE DEST
>cp first.txt. second.txt
rm
-Does not remove directories by default
-Directories must be empty to be removed with
“rmdir” or must be removed with “rm-r”
mkdir
-mkdir Directories
>mkdir notes
chmod
1
chmod
2
chown
-sudo chown [OWNER : GROUP] file
iwconfig / ifconfig
ps
apt-get
-Install , update , remove
>sudo apt-get install wireshark
vi
-vi File
>vi script.sh
-Save (write) the file & quit = :wq
dd
-dd if = of = [Options]
-Restoring from an image
>dd if = / tmp / sda -image.img of = / dev / sda