Network Services
ssh demo@linuxzoo.net
Intro 1 :
ssh demo@linuxzoo.net
whoami
su - demo
cal 12 2002
cal 2005 > ~/yearfile
cat ~/yearfile
ls -a
ls -l
cp yearfile yearfile2
cp yearfile yearfile3
mv yearfile3 thisyear
rm yearfile
cat thismonth yearfile2 thisyear > bigfile
Intro 2 :
Test
cd ~
mkdir work letters scripts
mkdir work/progs work/tutorial work/misc
cp /etc/group /etc/vimrc ~/work/misc
mv vimrc ~/work/progs
cp ~/bigfile ~/work/tutorial/bigfile2
cp ~/work/tutorial/bigfile2 ~/scripts
Network Services 1
cd ~mysql
pwd
/var/lib/mysql
mkdir ~/gordon
mkdir ~/Gordon
mkdir ~/My\ Documents
Wildcard:
cd ~
cp
file ~/work/
ls ~/work/
cp thismonth ~/letters/let1.doc
cd ~/letters/
cp let1.doc let2.doc
cp let1.doc let3.doc
ls
cp ~/letters/let1.doc ~/work/misc/rpt1.doc
cp ~/letters/let2.doc ~/work/misc/rpt2.doc
cp ~/letters/let3.doc ~/work/misc/rpt3.doc
ls ~/work/misc/
mv ~/work/misc/[23] ~/work/scripts/
rm -i ~/work/scripts/r*
ln ~/bigfile ~/work/progs/biglink
ls -l ~/bigfile
ln -s ~/thismonth ~/work/progs/mylink
ln -s /home/demo/thismonth ~/work/progs/mylink2
ls -l ~/work/progs/mylink2
Permission
stat -c "%a" /home/demo/bigfile
Network Services 2
ls -l /home/demo/bigfile
chmod u-rx scripts
chmod u+r scripts
Could ls , but not access contents
chmod 755 scripts
026
Pipes
test
cat club_members names | sort > s1
cat club_members names | sort -r > s2
sort -k5 -n club_members > s3
sort -t: -k3 -n /etc/passwd > s4
grep -m 1 'wta' /usr/share/dict/words
grep 'x' /usr/share/dict/words | wc -l
grep -vn 'nologin' /etc/passwd > s5
ls -l /etc | grep 'Mar' > s6
ls -l /etc | grep 'Jun' | sort -k5,5nr -k9 > s7
find /var -user root 2>/dev/null > s8
find /etc -name "*.conf" 2>/dev/null > s9
find /home/demo -newer s1 > /var/tmp/t1
find /etc -type f -size +1M 2>/dev/null > s10
find /usr/include -name 's*' -type f -size -13k -exec cp {}
/home/demo/smallc/ \; 2>/dev/null
Essentials
ls / | wc -l
sudo echo "Welcome" > /etc/motd
Network Services 3
id -u operator
ls -ld /var/cache/httpd
ls -ld /* | grep '^d' | grep -v 'r-xr-xr-x' | sort | head -n 1
chmod go+rx /var/log/httpd
sudo chown operator /etc/ntp.conf
sudo mkdir /root/dropzone & sudo chmod 733 /root/dropzone
sudo ln -s /usr/share/dict/words /root/words
grep -E 'a.*e.*i.*o.*u' /root/words | wc -l
grep "^m" words | grep -E '(....).*\1' | wc
du -sh /usr/share/doc/git-*
df -h /
sudo rm -rf /usr/share/doc/git-* & df /
cd /home/demo
cp file /home/demo/work/
find . -maxdepth 1 -type f -name 'file' -exec cp {} /home/demo/work/ \;
Network Services 4