Material for talk "Mastering the Linux command line".
Read along with git clone https://github.com/bertjan/mastering-the-linux-command-line
or at https://github.com/bertjan/mastering-the-linux-command-line.
Title:
clear
printf "\n\n"; printf "Mastering\nthe\nLinux command line" | figlet -ctk; printf "\n\n"; printf '%0.1s' ' '{1..49} && printf "Bert Jan Schrijver\n\n" && printf '%0.1s' ' '{1..48} && printf "[email protected]\n" && printf '%0.1s' ' '{1..52} && printf "@bjschrijver\n\n"
Intro:
(jp2a https://pbs.twimg.com/profile_images/1056994211499786240/qqhVN-Ur_400x400.jpg \
&& echo && echo \
&& wget -q -O - https://www.openvalue.nl/images/openvalue-white.jpg | jp2a - \
&& echo && echo \
&& jp2a https://yt3.ggpht.com/a/AGF-l79fDOsea1hkt8MMeKetvpDDE7qSlRfsKNaJQw=s288-mo-c-c0xffffffff-rj-k-no -i) | less
Special intro for April 5th only:
jp2a https://www.expandior.nl/wp-content/uploads/2021/03/Frank-Walinga-e1618911733788.jpg
Assumption: you know the basics like cd
, ls
, cp
, mv
.
- Terminal session, shell, bash
- man, help, -h, --help
- pipes: intro
- tab completion
- cd -
- find
- locate
- which
- up arrow
- history, !! and !
- ctrl-r
- file
- diff
- vi
- ssh key authentication, ssh-copy-id, ssh tunneling
ifconfig(deprecated) -> ip- ping
- telnet
- curl
- scp, sftp
- rsync
- cal
- bc
- .profile
- aliases
- ctrl-a ctrl-e ctrl-l ctrl-d ctrl-c
- less shift-g shift-f
- brace expansion:
echo a{d,c,b}e
,echo test{1..10}
- watch
- screen
- tee
- head, tail (-f)
- cat, grep, awk, cut
- sort, uniq
(
watch -n 0.1 "cat app.log | grep DispatcherServlet | grep ': GET' | cut -d ':' -f 4- | sort | uniq -c"
) - command substitution $(..)
- wc
- sed
- ; vs &&
- Output redirection > >>
- top (
dd if=/dev/urandom | bzip2 -9 >> /dev/null
) - strace (
sudo strace -p $(pidof vi) 2>&1 | grep read
) - vmstat
- netstat
- lsof -
lsof -i :8080
- du
- intro, make executable
- variables
- Command line args
- If/then/else
- functions (
function test1 { echo test $1; }
)
- Bats: Bash Automated Testing System
- What's this:
:(){ :|:& };:
- telnet telehack.com
- telnet mapscii.me
Hit me!
'Slides' are at https://github.com/bertjan. Questions? @bjschrijver on Twitter.