Introduction: Short Linux Tutorial

About: Occupation: tech support

Short Linux tutorial that I wrote for Per Scholas in the South Bronx. Text and HTML file attached.

Proposed Linux Curriculum for Per Scholas

1. Start with my 30+ page PDF presentation on Linux, its history and overall development process

2. Boot up a Linux distribution from CD, ie: Puppy Linux, Linux Mint. All students get to keep the CD. Does not touch the hard drives.

3. Basics of the Linux Command line

4. Explain Linux file structure

5. The vi editor

6. Basic shell scripts

7. Free Software for Windows: LibreOffice (Writer, Calc, Impress, Base), Gimp, SweetHome 3D, WAMP stack (Windows, Apache, PHP, MySQL), ClamWin, 7zip, FileZilla, Notepad++, FastStone Image Editor

Step 1: Tutorial Below

Proposed Linux Curriculum for Per Scholas

1. Start with my 30+ page PDF presentation on Linux, its history and overall development process:
https://www.instructables.com/id/Short-Linux-tutorial/

2. Boot up a Linux distribution from CD, ie: Puppy Linux, Linux Mint. All students get to keep the CD. Does not touch the hard drives.

3. Basics of the Linux Command line

4. Explain Linux file structure

5. The vi editor

6. Basic shell scripts

7. Free Software for Windows: LibreOffice (Writer, Calc, Impress, Base), Gimp, SweetHome 3D, WAMP stack (Windows, Apache, PHP, MySQL), ClamWin, 7zip, FileZilla, Notepad++, FastStone Image Editor
===============================================
Details for the commands to be reviewed:
1.  ls: lists contents of folder/directory
2.  ls -l: long form of listing contents, includes date, size, permissions
3.  pwd: print working directory; current directory you are in
4.  cp: copy a file
5.  mv: rename a file
6.  man: get additional information about a command; explain the options for that command
7.  info: same as man
8.  cd: change directory
9.  cd by itself takes you to your home directory
10.  cd .. : go up one directory level
11.  cd / :  go to root level of directory
12.  | : pipe; sends result of comannd to another command
13.  more: read a file one page at a time; used with pipe or by itself
14.  > : send results to text file; ie: ls > filename.txt
15.  top: show all active processes; kill processes; CPU/RAM usage
16.  df : disk free; disk usage
17.  ps: show user processes
18.  fg : bring paused process to front/foreground
19.  kill: terminate a process
20.  clear: clear the screen
21.  grep: search for text inside a file; grep [search term] [file name]
22.  grep can also be used to search for files in file listing; ls | grep [search term]
23.  ifconfig: interfact configuration; network information and status
24.  touch: creates a file
25.  mkdir: makes a directory
26.  echo: prints to screen
27.  chmod: change mode; changes permissions on file; chmod 755; explain number codes for R-W-E
28.  ./[command] - run command in current directory
29.  uname: prints information about the system
=========================================================
Linux file structure:
1.  / : root directory; bottom of directory tree
2.  /bin : contains basic binary or executable programs, ie: ls, kill, echo, uname
3.  /sbin : system binaries; additional programs for admin and system purposes
4.  /etc : configuration fiel; use vim to modify
5.  /home : Linux is multiuser system; each user has their own directory here
6.  /dev : device files; eg: /dev/cdrom - CD/DVD; hard drive paritions - /dev/hda, /dev/hda1
7.  /mnt : generic point to mount devices, ie: /dev/cdrom
8.  Basic diagram:
   /home  /etc  /dev  /mnt
      ^    ^     ^     ^
	    ^    ^   ^    ^
		  ^  ^   ^  ^
           / (root)
==========================================================
vi editor:
1.  vi editor - base Linux editor; on every Linux/BSD system; once know it, can work on any computer
2.  vim - vi iMproved; added features to vi
3.  vim [filename] - start vim; file can be new or existing
4.  With text files in Linux, do not need to add an extension, but it is good to do so.
5.  Linux shell files end with ".sh"
6.  Python files end with ".py"
7.  vim has 2 modes: insert and read mode
8.  Get to insert mode by hitting "i"
9.  Get out of insert mode by hitting "Esc"
10.  Save or write to a file - :w [Enter]
11.  Quit vim - :q
12.  Write and quit at the same time - :wq
13.  ":" indicates issuing a command to vim, not editing a file
14.  In read mode, "x" will delete a character
15.  "dd" deletes a line (in read mode)
16.  Search inside a file- :/[string] [hit Enter]
17.  After first search result, hit "n" to get to next instance
18.  o - open a new line after the one your are on for editing
19.  Movement within Read Mode: "H" is left
20.  "J" is down
21.  "K" is up
22.  "L" is right
23.  While in Insert Mode, can delete using "Backspace" or "Del" keys
==========================================
Shell Scripts
1.  Basic programming; will allow you to run/execute multiple commands at once
2.  Can use vim editor to create scripts; can also use Nano and Pico
3.  Print statements to screen using echo: echo ""Hello World!""
4.  Save the file and change the permissions to allow you to run it: chmod 755 [filename]
5.  Run ls -l to check the permissions are ok
6.  chmod command works with number codes: Read: 1, Write: 2, Execute: 4; add them together to get permissions
7.  chmod 755 is Read-Write-Execute for the owner(1+2+4=7); Read-Execute for the group(1+4=5); 
Read-Execute for everyone else (1+4=5)
8.  Variables - hold values; ie: alpha = 5, firstvariable = 8
9.  To get input from the user via the keyboard use read command: read alpha
10.  To print a variable use the "$" sign; ie: "The variable is: $alpha"
====================================
Free Software for Windows
1.  LibreOffice (Writer, Calc, Impress, Base): word processor, spreadsheet, presentation program and database.
Excellent office application solution; much high quality than Microsoft Office
2.  Gimp: GNU Image Manipulation Program: robust image creator and editor
3.  SweetHome 3D: easy to use 3D modeling program; can create 2D images and convert to 3D
4.  WAMP stack (Windows, Apache, PHP, MySQL): install and use webserver and MySQL database
5.  ClamWin: excellent anti-virus; low footprint
6.  7zip: compression and decompression program
7.  FileZilla: graphical file transfer program
8.  Notepad++: excellent text editor/programming editor
9.  FastStone Image Editor: simple image editing program
Explore Science Contest

Participated in the
Explore Science Contest

Tools Contest

Participated in the
Tools Contest