Outline
Feel free to improvise over this outline by adding new sections, chapters etc
This book is an introduction to using the shell with a focus on empowering GNU/Linux newbies. This page has an outline. The book itself is being written at:
http://en.flossmanuals.net/bin/view/CommandLineIntro/WebHome
It is meant to be fun and encourage the reader to play, so it is not organized in a formal manner (for instance, discussing all metacharacters in one place). Instead, features are introduced in the context of useful tasks. Rarely used features are not discussed.
The main topic is the GNU/Linux Bash shell, but useful features of the Korn shell and zsh may be introduced in advanced chapters. The C family of shells and non-Unix shells are beyond the scope of the book.
It assumes the reader is familiar with graphical interfaces, and refers to one or more free desktop environments where discussions of GUIs are necessary.
- Put yourself in command: why knowing the command line is useful
- Example: show a set of operations that require many menus and clicks to accomplish in a GUI (for instance, image manipulation) and then how to do the same things in a single command (for instance, using ImageMagick).
- The value of scripting
- Other places where command-line skills are useful
- Working over a network (when remote terminals or X redirection are unavailable or too slow)
- At jobs and cron jobs
- Invoking commands through GUI launchers
- Seeing what's going on (ps output, other system trouble-shooting)
- Working over a network (when remote terminals or X redirection are unavailable or too slow)
- Getting started
- What do we mean by a "command"?
- What ways can you enter commands?
- Opening a terminal window
- Alternative ways to run a command on various popular desktops
- Different shells
- This book focuses on Bash
- We tell you what's non-portable (doesn't work with older shells)
- Privileged (superuser) commands
- sudo
- su
- Beginning syntax: command-line options
- Moving around directories
- Pathnames
- simple, absolute, and relative
- The . and .. directories
- cd, pushd, etc.
- Pathnames (syntax)
- Using the history (through the readline facility)
- Emacs mode
- vi mode
- A few useful bits of syntax
- Enclosing strings in quotation marks
- Escaping special characters through quotation marks and backslashes
- Continuing a command over multiple lines
- White space as separators (any amount is treated the same)
- Basic commands
- Commands people use every day
- pwd
- ls -al
- cd
- chown
- chmod
- more, less
- mv
- cp
- rm
- wc
- diff
- gzip, gunzip, gzcat
- rm, rmdir
- mkdir
- find
- grep
- passwd
- kill
- telnet, ssh
- ftp
- apt-get, yum
- echo
- setenv, unset
- du -h
- lynx
- ln
- Permissions
- Viewing through ls
- Setting through chmod
- +x syntax
- 777 octal syntax (a figure is useful to show bits
- Manipulating processes
- Interrupting (CTRL-C)
- ps and kill
- Processes and jobs (background)
- Redirection
- Using < and > and variations
- File descriptors (standard input, output, and error)
- Cheaper by the dozen: operating on lots of files in a single command
- Globbing
- The find command
- The "for" control construct
- All that typing is too much work
- Command and filename completion
- Using the history, part 2 (through the ! and ^ facilities)
- Aliases
- Functions
- More command-line mastery
- Piping commands
- Taking advantage of the exit status
- The if/then construct
- The && and || constructs
- Subcommands
- The $(command) syntax
- The `` backtick syntax
- Parameter substitution
- Multiple and remote sessions
- GNU Screen
- SSH
- Virtual terminals (GNU/Linux)
- Useful customizations
- Variables
- Syntax
- Environment variables
- The search path
- Finding a command (which)
- Multiple locations for commands, and using symbolic links
- Setting prompts
- Localization
- How the computer generally chooses locale
- How to explicitly control locale
- Effects of locale on Bash
- Effects of locale on common programs and operations
- Variables
- Before scripting: learning a text editor (keep it short; use screenshots)
- gedit
- Kedit
- nano
- vi
- Emacs
- Saving useful changes: .bashrc and other startup/shutdown files
- The value of portability (lowest common denominator commands)
- Scripting (mostly an example-based or recipe-based chapter, because all the important constructs have been introduced)
- Making scripts executable
- More control constructs (while, until, case, etc.)
- Argument lists
- How to keep the script maintainable
- Use variables
- Know where you begin (which directory, whether you're superuser)
- Look before you leap (does a file you want to read exist, etc.)
- Check error status
- Error messages
- Here documents (the << syntax)
- Sourcing other files
- Restricting access
- Using permissions
- The suid bit
- Other scripting languages
- Why use something else besides a shell
- Python
- Ruby
- Perl
- Awk