source ./doinit 
echo
me() {   $(id -un):$(id -gn)@$(hostname -s); }
type -a me
echo $(id -un)
$(id -un)
(id -un)
var=$(id -un)
echo $var
$(id -gn)
echo $(id -gn)
uname -r
uname -a
tar caf myhome.tar.gz $HOME
rm myhome
rm myhome.tar.gz 
tar caf demospace.tar.gz ~/demospace
ls -la
ls -la demospace.tar.gz 
rm demospace.tar.gz 
rm bash_history.2024-01-15
kill %
source ./doinit 
echo test 
# we start at 12:00
echo test
#emacs
#vim
nano
ls -l
vim hello_bash.sh
hello_bash.sh
ls -l hello_bash.sh
chmod +x hello_bash.sh 
ls -l hello_bash.sh
hello_bash.sh
./hello_bash.sh
#mkdir bin
cd bin/
ls -l
mv ../hello_bash.sh .
ls -la
cd ..
echo $PATH
ls -l /bin/bash
export PATH=$PATH:~/demospace/bin
echo $PATH
hello_bash.sh 
type -a hello_bash.sh 
clear
python3
tar -caf demospace.tar.gz ../demospace
ls -la
cd bin/
vim tarme.sh
chmod +x tarme.sh
type tarme.sh
cd ..
tarme.sh 
clear
var='my first bash variable'
echo $var
vim bin/hello_bash.sh 
hello_bash.sh 
printenv 
clear
echo $PATH
echo $HOME
echo $SHELL
clear
man bash
echo $var
unset var
echo $var
echo ${var:?not defined}
echo ${var:=default value}
echo $var
fpath=/home/user/archive.tar.gz
echo $fpath
echo ${fpath##*/}
echo $fpath
fpath2=${fpath##*/}
echo $fpath2 
echo ${fpath%/*}
vim bin/hello_bash.sh 
hello_bash.sh 
cd bin/
vim fpath.sh
chmod fpath.sh
chmod +x fpath.sh
fpath.sh 
cat fpath.sh 
clear
echo test
echo $?
vim functions
du -hs * .[!.]* | sort -h
vim functions
ls -l functions 
source functions 
type -a spaceusage
spaceusage 
vim functions 
source functions 
type -a spaceusage
spaceusage ../../demospace
spaceusage 
vim functions 
cp functions space.sh
vim space.sh 
chmod +x space.sh 
space.sh 
clear
vim functions 
source functions 
type -a me
me
hostname -s
id -un
$(id -un)
vim functions 
source functions 
me
clear
cat functions 
#tar -caf $(basename $(pwd)).$(date +%Y-%m-%d).tar.gz .
date +%Y-%m-%d
pwd
basename $(pwd)
tar -caf $(basename $(pwd)).$(date +%Y-%m-%d).tar.gz .
ls -l
vim tarme.sh 
# back at 14:22
clear
alias cl='clear'
cl
cd ..
ls -l
find . -iname 'bash'
find . -iname '*bash*'
vim bin/functions 
source bin/functions 
type -a ff
ff bash
ff
vim bin/functions 
source bin/functions 
ff
type -a ff
cl
ping 8.8.8.8
ping -c 1 8.8.8.8
ping -c 1 8.8.8.8 > /dev/null
ping -c 1 8.8.8.8 > /dev/null; echo $?
ping -c 1 8.8.8.888 > /dev/null; echo $?
ping -c 1 8.8.8.888 > /dev/null 2>&1; echo $?
ping -c 1 8.8.8.888 &> /dev/null &; echo $?
ping -c 1 8.8.8.888 >& /dev/null &; echo $?
ping -c 1 8.8.8.888 &> /dev/null; echo $?
ping -c 1 8.8.8.888 &> /dev/null && echo 'we are online'
ping -c 1 8.8.8.8 &> /dev/null && echo 'we are online'
ping -c 1 8.8.8.8 &> /dev/null && echo 'we are online' || echo 'we are down'
ping -c 1 8.8.8.888 &> /dev/null && echo 'we are online' || echo 'we are down'
ff () |
{      word=${1:?search word is missing};     find . -iname "*$word*"; }
du -hs * .[!.]* &| sort -h 
du -hs * .[!.]* |& sort -h 
du -hs * .[!.]* 2>/dev/null | sort -h 
# when done with the exercise, see you tommorow at 12:00
cl
kill %1
