###TODO
- History of UNIX
- Basics of navigating and terminal commands, top 50 useful bash commands
- grep, sed, awk fundamentals
- Do some simple commands in terminal, ie moving specific files recursively from a directory
- write a shell script to generate a randomized MAC address you can use at limited time wifi hotspots
- crontabs
- Setting up a postgres db
- Installing, updating and maintaining packages (apt-get, brew, pip)
UNIX is a operating system developed very long time ago, by AT&T (Bell Labs) 1960s. Back then only limited access to it, even then it was expensive. One of the users was University of Berkeley, most of the open source OS is based on the University of Berkeley version of UNIX called BSD stands for Berkeley Software Distribution. Eventually BSD looked nothing like the original UNIX, BSD became very popular which led to many other versions of it such as FreeBSD, Darwin, MacOSX.
Another branch of UNIX was created in Vrjie Universiteit in Amsterdam, called Minix. This wasn't that popular but Minix gave birth to another branch called Linux which is pretty much what most of world runs on.
This is the worker that manages, processes, prioritizes programs and directly works with the hardware. A more realistic map of a Linux kernel.
cd
ls
pwd
mkdir
touch
cat
cp
mv
rm
|
Pipe function
>
Redirector
>>
double redirector (append)
Standard Input 0 STDIN Standard Output 1 STDOUT Standard Error 2 STDERR
- Write a shell script that makes 10 new directories labelled
folder[i]
- inside each folder create a new textfile called
file[i].txt
- In each text file write this text "This is the text file number [filename numer] in [foldername]
- Once it has done that list all the directories and output it to a log file labelle
log.txt
grep
Global Regular Expressions Print
ls -l | grep [keyword]
awk
sed
Exercise
- Using grep find Error in a log file and get 2 lines below it
- Using awk Get 3rd column from a text file.
- Replace all cats with dogs in a text file.
wc -l
lsblk
man [shell command]
man -t manpage | ps2pdf - filename.pdf
du -a -h --max-depth=1 | sort -hr
df -h
lsblk
!:-
find . -name '*.[file extension]' -exec mv "{}" ./ \;
nohup command &
mount /dev/[blockname] path/to/folder
find . -name "[folder-parameters]" -type d -exec rm -r "{}" \;
apt-get installs a much older version of pip which can lead to problems, completely remove python-pip with:
apt-get remove --purge python-pip
then:
curl https://bootstrap.pypa.io/get-pip.py | sudo python
using sudo if required
openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/:$//'