Note: I'll make up an active learning exercise about 10 minutes before the end Distributions: (You probably figure this out for lab 1) - Recall that Linux is a kernel - You need some other software to use it! - Usually: + A shell (BASH, DASH, CSH) + A gui (X11, Android) * And a desktop environment on top of X11 * Like Gnome, KDE, Unity, XFCE, etc. + A remote access server (OpenSSH) A few common distributions: - Debian: Debra and Ian started it + For old folks + Package management + Ubuntu and many others are derived from it + .deb packages + stable, testing, unstable * toy story - Ubuntu: Means human-ness or something + Debian for youth + adjective, animal. like "Karmic Koala" - Red Hat: Black vs. White hats + Fedora + rpm packages - Gentoo: A type of penguin + portage system and emerge + compiling... + No releases - Slackware: Church of the Subgenius + no package manager, as of 10 years ago + .tgz "packages" - There are a LOT of distributions. Starting to learn the command line: - Navigating: ls and cd - File tree: / is the root + A, B, C, etc. on Windows + mounting - Another program: man - General note on structure: commmand/program SPACE argument1 SPACE argument2 ... - argument: information for the program or command + Also called a parameter - flags: A special argument starting with - + Settings for that run of the program + Generally not persistent - Commands for you to try: who, w, top, finger Couple quick notes for being fast: tab auto completes names up arrow retrieves previous commands cd - changes to the previous directory ctrl+r does a search for previous commands Passwords on *nix, /etc/passwd why I can't find out your password john the ripper Permissions and chmod BASH and shells shell, terminal, these names Brief flowchart for a shell What if we just run "cat" and press enter? Let's learn a command: who Also w and finger GUI on Linux: Window Manager Desktop Environment Display Manager I'll show you a couple Time for a walk: Some computers with names Name is often in the prompt uname -n Separate the computer in front of you from the one you are using Since you'll probably ask: X11 forwarding over SSH Remote desktop is another way to do this Interlude: Why don't I have to type a password all the time? Cryptographic authentication (is stronger, depending) Let's talk about networks! Enough for the moment, anyway Internet Protocol Addressing with IP Ports Standard ports A bit more about how things work protocols DHCP, briefly, and the MAC address DNS, and 8.8.8.8 Ruining the magic kingdom: Firewalls and NAT Some connections can only be initiated from one end Port forwarding (for NAT) A relay point on the outside - ssh can do this Text editing, and nano text file compared to word processors - Word processors are for printers - So is .pdf - Not .html - You can eat cake with a spoon (MS Word for code is worse than this) - Source code is normally stored in a text file nano: Easy to learn, syntax highlight, generally ok gedit: Easy to learn, syntax highlighting, generally ok, needs GUI vim: Not as easy to learn, LOTS of features, has a graphical version emacs: Medium learning difficulty, LOTS of features, has graphical version code: A bit different way to work, but avoids editing in remote terminals You need to know how to use a text editor to be competent on Linux I use vim, but that doesn't mean you should We talked about the file tree a bit yesterday But now a tour! Slash direction is opposite DOS/Windows Case matters! /tmp /etc /home /dev and /proc /root (and who is root?) /bin, /usr, /opt, /sbin, /sys, /lib, /lib64 /var and /var/log /usr/share/doc Special characters in filenames: Spaces / - (not special) . (not special) Linux does not require file extensions They are commonly omitted on regular text files ~ (your home directory, if it is first) cd with no parameters If we get this far: Writing a program with C We'll use the text editor again Let's learn another command: grep grep and files Finally: pipes (combining grep and who)