This closely follows the textbook Section 1. I mention a few things I want
to expand on, but mainly it keeps your absent-minded professor on track.
- Ch. 1-3: Exploring with the shell.
- Terminal emulators.
- Used to run the shell.
- Originally physical devices.
- Basic commands from text: date, cal, df,
free, exit
- Virtual terminals.
- File system tree.
- Directories, files, etc.
- Usual GUI view shows the tree.
- Shell is like standing on the road instead of looking at the map.
- Commands pwd, cd, ls
- Relative and absolute path names.
- cd shortcuts.
- cd to home
- cd - to previous
- cd ~username to that user.
- Home directory.
- Located somewhere in the tree.
- Just like other directories, but you are allowed to create files there.
- file and less commands
- File system tour (ch. 3).
- Symbolic links, and /lib
- Ch. 4: Manipulating files and directories
- Wildcards, for representing groups of files.
- * Match any characters.
- ? Match one character.
- [characters] Match a class of characters.
- [!characters] Match not a class of characters.
- mkdr, rmdir: Creating and removing directories
- cp: Copy files.
- Single files.
- Multiple files to a directory target.
- Overwriting and the -i option. Commonly aliased.
- Plain cp won't copy directories, but -r.
- Use -u only copy new files.
- mv: Rename (move) files.
- Single or multiple files, directory target.
- Can overwrite target. Again -i can warn you.
- rm: Delete (remove) files
- Single or multiple listed files.
- -i option again.
- Use -r to remove an entire subtree.
- There is no undo!
- When you remove it, it's gone.
- The -i option can help. Often, your distro will alias it.
- Book suggests testing with ls first.
- ln: Links.
- Symbolic v. hard links.
- Implementation difference.
- Hard limited to a physical device.
- The -l and -s options to cp.
- Ch 5: Commands
- Types of commands.
- Shell builtins
- Executable commands
- Locations.
- The PATH
- The which command.
- Aliases
- Shell functions (later).
- The type command.
- Documentation
- help: shell builtins
- command --help: might give you some
- man: For manual. Display the manual page.
- Sections.
- Say “man N topic” to select a section.
- Sections traditional, and may be kind of odd these days.
- “man N intro” usually gives some general info on the section.
- Sometimes names reused.
- Section 1 User commands.
- Section 2 System calls.
- Section 3 Library functions.
- Section 4 Device files.
- Section 5 File formats.
- Section 6 Games.
- Section 7 Misc
- Section 8 Administrative commands.
- Not all programs have a man; GUI programs often don't.
- Pages are formatted and displayed using less.
- If it shows you the bash man page, you might want to use the help cmd.
- Pages are stored in /usr/share/man and other places.
- apropos: search the man pages.
- whatis: brief description.
- info: longer command description
- Info system created by gnu as a man alternative.
- Entries are non-HTML hypertext documents.
- Movement is by control codes, not mouse clicks.
- Move around with arrows.
- Scroll with page-up (or backspace) or page-down (space).
- Follow a link by moving to it and pressing enter.
- Next, previous, or parent nodes: n, p, u.
- Quit with q.
- Distributed documentation
- Look in /usr/share/doc/program
- Misc. doc files distributed with the program
- README, COPYING, many others without much structure.
- And fear not Google.
- Using the alias command. List, create, use, unalias.