Linux basics (part 1)

1,848 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,848
On SlideShare
0
From Embeds
0
Number of Embeds
560
Actions
Shares
0
Downloads
44
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • GREG Ask audience about their experience level.
  • GREG History of UNIX GNU/BSD
  • GREG Supercomputers source: http://www.top500.org/overtime/list/32/os Distro count: http://futurist.se/gldt/ Number of devs & commits: http://www.linuxfoundation.org/docs/lf_linux_kernel_development_2010.pdf covers 2.6.11 though 2.6.35 1 commit every 3 minutes, 24/7/365
  • LANCE
  • LANCE Fedora – RHEL – rpm based. 18mo. Release cycle for fedora, X years of support for each major RHEL version Debian – Ubuntu – deb based. Debian is community based, Ubuntu is based off of debian, targets ease of use for end-user. Has short and long-term supported releases Gentoo – ebuild based, much more customizable, but can be more difficult to deploy/maintain
  • LANCE Fedora – RHEL – rpm based. 18mo. Release cycle for fedora, X years of support for each major RHEL version Debian – Ubuntu – deb based. Debian is community based, Ubuntu is based off of debian, targets ease of use for end-user. Has short and long-term supported releases Gentoo – ebuild based, much more customizable, but can be more difficult to deploy/maintain
  • LANCE
  • GREG Bash is the default shell on Linux machines Explain architecture: built in commands vs. external binaries Quick overview of filesystem, ie. Full vs. relative paths
  • GREG Demo commands: Directory movement and file manipulation: Cd, pwd, ls, rm, mv, touch User info: id, whoami, w Pipes, redirection (pipe.txt, redirect.txt) Special variables: $?, $$ (pid.sh), !!, !*, !$
  • GREG
  • GREG
  • GREG
  • GREG
  • LANCE
  • LANCE
  • LANCE
  • LANCE
  • LANCE
  • Linux basics (part 1)

    1. 1. <ul>Linux Basics Part 1 </ul><ul>OSU Picture © Greg Keene </ul>
    2. 2. <ul>Introductions </ul><ul>Lance Albertson Greg Lund-Chaix </ul><ul>source: http://shesawake.com/ </ul>
    3. 3. <ul>Goals for this Talk </ul><ul><ul><li>Linux Overview
    4. 4. Linux distributions
    5. 5. System overview
    6. 6. More detail: permissions, processes, package management, services </li></ul></ul>
    7. 7. <ul>Linux Overview </ul><ul><ul><li>Unix-like operating system
    8. 8. Free, open source software
    9. 9. Runs servers, desktops, phones, tablets, network equipment and more. </li></ul></ul>
    10. 10. <ul>Linux Statistics </ul><ul><ul><li>Supercomputers More than 90% of the top 500
    11. 11. Number of distributions More than 350
    12. 12. Number of developers 1,000 developers contributed in 2010
    13. 13. Number of commits to linux kernel last year 195,579 commits in 2010 </li></ul></ul>
    14. 14. <ul>Linux Distributions </ul><ul><ul><li>Packaging of applications around a Linux kernel
    15. 15. Different distributions have different target audiences
    16. 16. Distribution lifecycles vary </li></ul></ul><ul>source: http://www.guilfordlug.org </ul>
    17. 17. <ul>Common Linux Distributions </ul><ul><ul><li>Fedora / RedHat Enterprise / CentOS
    18. 18. Debian / Ubuntu / Mint
    19. 19. Gentoo / Arch </li></ul></ul><ul>source: http://www.guilfordlug.org </ul>
    20. 20. <ul>Choosing a Distribution </ul><ul><ul><li>Server/desktop/other
    21. 21. Existing infrastructure
    22. 22. Admin experience
    23. 23. Support contract
    24. 24. Release supported lifetime </li></ul></ul>
    25. 25. <ul>Linux System Overview </ul><ul>source: wikipedia </ul>
    26. 26. <ul>bash: Bourne Again SHell </ul><ul><ul><li>Default shell on Linux
    27. 27. Originally based off of the Bourne Shell (sh)
    28. 28. Learn it, live it, love it </li></ul></ul>
    29. 29. <ul>Basic bash commands </ul><ul>ls *.txt file1.txt  file2.txt  file3.txt ls *.txt > list for i in `cat list`;       do cp &quot;$i&quot; &quot;$i&quot;.bak ;  done ls *.txt* file2.txt  file1.txt.bak  file2.txt  file2.txt.bak  file3.txt  file3.txt.bak </ul>
    30. 30. <ul>Documentation </ul><ul><ul><li>Most packages include man pages for documentation
    31. 31. More extensive than the --help flag on CLI
    32. 32. Stored in different 'sections' </li></ul></ul><ul>Picture © Flickr user 'bobeirasa' </ul>
    33. 33. <ul>Users and Groups </ul><ul><ul><li>Users and groups are stored in /etc/passwd and /etc/group
    34. 34. Each user name and group name is linked to a number (UID/GID)
    35. 35. UID 0 = root
    36. 36. 0-99 typically used for system/service accounts </li></ul></ul>
    37. 37. <ul>File Permissions </ul><ul><ul><li>Three roles: user (file owner), group, other (“world”)
    38. 38. Three permissions: read, write, execute </li></ul></ul><ul>Picture © Flickr user 'amagil' </ul>
    39. 39. <ul>root user </ul><ul><ul><li>root user = full access to everything on the system </li></ul></ul><ul><ul><li>sudo , su – change user </li></ul></ul><ul><ul><li>Don't use root user unless you have to! </li></ul></ul><ul>Comic: http://xkcd.com/149/ </ul>
    40. 40. <ul>Components of a process </ul><ul><ul><li>PID: Process ID number
    41. 41. PPID: Parent PID
    42. 42. UID & EUID: real & effective user ID
    43. 43. GID & EGID: real & effective group ID
    44. 44. Niceness
    45. 45. Control terminal </li></ul></ul>
    46. 46. <ul>Signals </ul><ul><ul><li>Sent to procs as communication
    47. 47. Sent to terminal driver to kill, interrupt, or suspend
    48. 48. Sent by admin to kill
    49. 49. Sent by kernel </li></ul></ul><ul>Picture © Flickr user 'atomicshark' </ul>
    50. 50. <ul>Signals: Types you should know </ul><ul><ul><li>HUP, INT, QUIT, KILL, BUS, SIGV, TERM, STOP, TSTP, CONT, WINCH, USR1, USR2 </li></ul></ul><ul><ul><li>Can catch, block, or dump core? </li></ul></ul><ul><ul><li>BUS & SEGV  – error signals
    51. 51. KILL & STOP  – cannot be blocked
    52. 52. WINCH  – term emulators </li></ul></ul>
    53. 53. <ul>ps: monitor processes </ul><ul><ul><li>primary tool for monitoring processes
    54. 54. differ between UNIX's
    55. 55. show PID, UID, priority, control term, memory, status, etc
    56. 56. complex over the years, archaic
    57. 57. pstree </li></ul></ul>
    58. 58. <ul>top: monitor in real-time </ul><ul><ul><li>“ big picture” in real time
    59. 59. refreshes every 2-3 seconds
    60. 60. kill, renice, sort, memory, etc.
    61. 61. htop – even better </li></ul></ul><ul><ul><ul><li>color, prettier, more configurable </li></ul></ul></ul><ul>Picture © United Artists from 'Hackers' </ul>

    ×