Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Unix for developers

0 views

Published on

Unix for developers introduction

Published in: Engineering

Unix for developers

  1. 1. *nix for developers part 1 @mitemitreski http://www.mitemitreski.com/ 8.April.2014 tricode talks
  2. 2. Agenda Short history Overview of var commands Demo of simple use cases
  3. 3. Short history ● Ken Thomson ● Dennis Ritchie ● unix like systems 1969 ● official release 1979 "...the number of UNIX installations has grown to 10, with more expected..." - Dennis Ritchie and Ken Thompson, June 1972
  4. 4. Linux
  5. 5. RMS and GNU/Linux
  6. 6. All the flavours ● Multiprocess ● Multi-user ● Timesharing ● Different command between flavours
  7. 7. Start-up init tab systemv crond http://en.wikipedia.org/wiki/Init
  8. 8. Runlevel >runlevel Operating System Default runlevel AIX 2 CentOS 3 (console/server) or 5 (graphical/desktop)[5] Debian 2[6] Gentoo Linux 3[7] Mac OS X 3 Mandriva Linux 3 (console/server) or 5 (graphical/desktop) Red Hat Enterprise Linux / Fedora 3 (console/server) or 5 (graphical/desktop)[8] Solaris 3[9] Ubuntu (Server and Desktop) 2[6]
  9. 9. Cron and crontab 00 20 * * * /home/oracle/scripts/export_dump.sh Cron expressions ( * / , -) # * * * * * command to execute # ┬ ┬ ┬ ┬ ┬ # │ │ │ │ │ # │ │ │ │ │ # │ │ │ │ └───── day of week (0 - 7) (0 to 6 are Sunday to Saturday, or use names; 7 is Sunday, the same as 0) # │ │ │ └────────── month (1 - 12) # │ │ └─────────────── day of month (1 - 31) # │ └──────────────────── hour (0 - 23) # └───────────────────────── min (0 - 59)
  10. 10. Entry Description Equivalent to @yearly (or @annually) Run once a year at midnight in the morning of January 1 0 0 1 1 * @monthly Run once a month at midnight in the morning of the first day of the month 0 0 1 * * @weekly Run once a week at midnight in the morning of Sunday 0 0 * * 0 @daily Run once a day at midnight 0 0 * * * @hourly Run once an hour at the beginning of the hour 0 * * * * @reboot Run at startup @reboot Crontab
  11. 11. Terminals tty telnetd sshd http://en.wikipedia.org/wiki/Computer_terminal
  12. 12. All the different shells SH sh, csh, ksh, zsh, bash oh my zsh Bean shell python java #!/bin/bash
  13. 13. Bash bash bashrc bash_profile /etc bash related .bash_history
  14. 14. List ls -alf ls -r
  15. 15. pwd/who/whoami mite tty7 :0 09:55 6:42m 5:55 4.16s i3 mite pts/0 :0 16:34 7.00s 0.06s 0.00s w mite pts/2 :0 14:52 2:23 0.23s 0.11s ssh mkooijman@amsjoslpe11 mite pts/3 :0 16:35 55.00s 0.32s 7:19 gnome-terminal
  16. 16. cat and tac + basic streams >> > 1> 2> 2>1 2>&1 | 0 Standard input STDIN_FILENO stdin 1 Standard output STDOUT_FILENO stdout 2 Standard error STDERR_FILENO stderr
  17. 17. ln and mv and rm -f -r
  18. 18. Important folders /usr /bin /usr/bin/ /dev/null /opt /var /tmp /home /proc http://www.cs.duke.edu/csl/docs/sysadmin_course/sysadm-72.html
  19. 19. Processes > ps -e > ps -f > ps -ef > ps axvf (interactive) >top >htop
  20. 20. Kill and Killall >kill PID >killall NAME >kill -9 PID >killall -9 NAME
  21. 21. Job control & Run the command in the background > long_cmd & CTRL-Z Stop the foreground process [Ctrl-z] Stopped jobs List background processes > jobs %n Refers to the background number n > fg %1 bg Restart a stopped background process > bg [2] big_job & fg Bring a background process to the foreground > fg %1 kill Kill a process > kill %2 CTRL-D logout CTRL-S, CTRL-Q (scroll lock)
  22. 22. >find http://en.wikipedia.org/wiki/Find find . -name 'my*' find . -iname 'my*' find . -name '*.mp3' -exec chmod 644 {} ;
  23. 23. >wget or GNU wget >wget http://www.example.com/ >wget --no-check-certificate https://www. example.com/
  24. 24. >curl >curl http://www.google.com >curl -L http://www.google.com >curl -o mygettext.html http://www.gnu. org/software/gettext/manual/gettext.html
  25. 25. Xargs find . -iname ‘*.php’ -print0 | xargs -0 svn add
  26. 26. Navigation and customization Shift + page up/down Ctrl + R var customizations
  27. 27. Credits Wikimedia foundation for the images used

×