H43KF

            -- Don't judge me too harshly.
            -- Oh, Mademoiselle, I investigate. I do not judge.

            Hercule Poirot. Three Act Tragedy. S12E02, 01:27:26

Unix for technician-automatician
================================ 

So far:

  cat    -- show file contents
  pwd    -- print work directory ( shows your current location)
  cd     -- change directory ( "." this ".." up "/" root "~" home)
  ls     -- list files (long format -l)
  rm     -- remove file (-r remove directory, -f by force)
  
Optional

  tar    -- archiving tool
  bzip2  -- compress / decompress (-d)
  wget   -- download
  sed    -- string editor (regular expressions, level "hard")

Some practical tasks
....................

!! Shows where am i in the file system . 

Sample session

  virtu@UBox:~$ pwd
  /home/virtu
  
!! 
!! Move to a new location. Show what files are located this place.
!! Move back "home" (your default location).
!!
 
Sample session.

  virtu@UBox:~$ cd PyLi/
  virtu@UBox:~/PyLi$ pwd
  /home/virtu/PyLi
  virtu@UBox:~/PyLi$ ls
  angle.py  elevator.py      recv.py       serial.cpp.elf   v-recv.py
  box.py    init-tty0tty.sh  selevator.py  serial.ino
  earth.py  morph.py         send.py       tronSerial.simu
  virtu@UBox:~/PyLi$ ls -l
  total 124
  -rw-r--r-- 1 virtu virtu   329 apr    2 11:41 angle.py
  -rw-r--r-- 1 virtu virtu   111 apr    2 15:46 box.py
  -rw-r--r-- 1 virtu virtu   191 apr    2 11:35 earth.py
  -rw-r--r-- 1 virtu virtu  5140 apr    2 09:51 elevator.py
  -rw-r--r-- 1 virtu virtu   162 märts 29 12:51 init-tty0tty.sh
  -rw-r--r-- 1 virtu virtu   335 apr    2 17:25 morph.py
  -rw-rw-r-- 1 virtu virtu   151 märts 19 21:33 recv.py
  -rw-r--r-- 1 virtu virtu  5687 apr    3 16:08 selevator.py
  -rw-rw-r-- 1 virtu virtu   171 märts 19 21:33 send.py
  -rwxr-xr-x 1 virtu virtu 67644 märts 24 22:34 serial.cpp.elf
  -rw-r--r-- 1 virtu virtu   374 märts 24 22:30 serial.ino
  -rw-r--r-- 1 virtu virtu  1153 märts 24 22:37 tronSerial.simu
  -rw-rw-r-- 1 virtu virtu  1088 märts 20 17:59 v-recv.py
  virtu@UBox:~/PyLi$ cd ~
  virtu@UBox:~$ pwd
  /home/virtu

!! 
!! Download PyLi-H42.tar.bz2. Create folder named new_place. 
!! Move this file to a new_place. 
!! What is inside archive? 
!! Extract there (it's archive). 
!! Show me where extracted files are. 
!! 

Sample session.

  virtu@UBox:~$ wget -c nelus.tpt.edu.ee/big/PyLi-H42.tar.bz2
  --2017-04-03 20:20:37--  http://nelus.tpt.edu.ee/big/PyLi-H42.tar.bz2
  Resolving nelus.tpt.edu.ee (nelus.tpt.edu.ee)... 193.40.160.1
  Connecting to nelus.tpt.edu.ee (nelus.tpt.edu.ee)|193.40.160.1|:80... 
  connected.
  HTTP request sent, awaiting response... 200 OK
  Length: 17787 (17K) [application/x-bzip2]
  Saving to: ‘PyLi-H42.tar.bz2’

  PyLi-H42.tar.bz2 100%[===================>]  17,37K  27,8KB/s in 0,6s

  2017-04-03 20:20:38 (28 KB/s) - ‘PyLi-H42.tar.bz2’ saved [17787/17787]

  virtu@UBox:~$ mkdir new_place
  virtu@UBox:~$ mv PyLi-H42.tar.bz2 new_place/
  virtu@UBox:~$ cd new_place/
  virtu@UBox:~/new_place$ cat PyLi-H42.tar.bz2 | bzip2 -d | tar tf -
  PyLi/
  PyLi/recv.py
  PyLi/earth.py
  PyLi/angle.py
  PyLi/morph.py
  PyLi/serial.ino
  PyLi/tronSerial.simu
  PyLi/send.py
  PyLi/box.py
  PyLi/init-tty0tty.sh
  PyLi/serial.cpp.elf
  PyLi/v-recv.py
  PyLi/elevator.py

  virtu@UBox:~/new_place$ tar xf PyLi-H42.tar.bz2 
  virtu@UBox:~/new_place$ ls -l
  total 24
  drwxr-xr-x 2 virtu virtu  4096 apr    2 17:25 PyLi
  -rw-r--r-- 1 virtu virtu 17787 apr    3 20:22 PyLi-H42.tar.bz2
  virtu@UBox:~/new_place$ cd PyLi/
  virtu@UBox:~/new_place/PyLi$ ls
  angle.py  elevator.py      recv.py         serial.ino
  box.py    init-tty0tty.sh  send.py         tronSerial.simu
  earth.py  morph.py         serial.cpp.elf  v-recv.py

!! 
!! Go back 'home' 
!! and destroy new_place folder with all it contents.
!!

  virtu@UBox:~/new_place$ cd ~
  virtu@UBox:~$ rm -rf new_place/

!!
!! download everything from
!!
!!   http://vpython.org/contents/contributed.html
!!

  virtu@UBox:~/H43$ wget http://vpython.org/contents/contributed.html
  virtu@UBox:~/H43$ cat contributed.html | grep "contributed/" | \
    sed "s/.\+href=\"/wget -c http:\/\/vpython.org\/contents\//" | \
    sed "s/\".\+$//" > dl_all.sh
  virtu@UBox:~/H43$ sh dl_all.sh
  virtu@UBox:~/H43$ ls
  bodies.py          Experimental_distutils.zip pixelplot.py
  boids.py           face.py                    povexport-2015-09-04.zip
  capital_letters.py GasInToroid.py             rotate_scene.py
  cherry_tree.py     gas_Venezian.py            rotating_book.py
  chessboard.py      grayscale.py               SaraivaDemo.py
  contributed        kepler.py                  setup.py
  contributed.html   look_around.py             stadium.py
  convert_stl.zip    monkey.py                  visualjoints.py
  cxvp_clock.py      movecamera.py              vspace.py
  dl_all.sh          movie.py                   zoom_and_spin.py        
  EMWave.py          pipes.py                   

