Unix Users's Guide

October 11, 2022

Jason W. Bacon

Senior Systems Programmer
University of Wisconsin -- Milwaukee
Research Computing Support

Permission to use, copy, modify and distribute the Unix User's Guide for any purpose and without fee is hereby granted in perpetuity, provided that the above copyright notice and this paragraph appear in all copies.


Table of Contents

1. Using Unix
1.1. KISS: Keep It Simple, Stupid
1.2. What is Unix?
1.3. Unix User Interfaces
1.4. Still Need Windows? Don't Panic!
1.5. Logging In Remotely
1.6. Unix Command Basics
1.7. Basic Shell Tools
1.8. Processes
1.9. The Unix File System
1.10. Unix Commands and the Shell
1.11. POSIX and Extensions
1.12. Subshells
1.13. Redirection and Pipes
1.14. Power Tools for Data Processing
1.15. File Transfer
1.16. Environment Variables
1.17. Shell Variables
1.18. Process Control
1.19. Remote Graphics
1.20. Where to Learn More
2. Unix Shell Scripting
2.1. What is a Shell Script?
2.2. Scripts vs Programs
2.3. Why Write Shell Scripts?
2.4. Which Shell?
2.5. Writing and Running Shell Scripts
2.6. Shell Start-up Scripts
2.7. Sourcing Scripts
2.8. Scripting Constructs
2.9. Strings
2.10. Output
2.11. Shell and Environment Variables
2.12. Hard and Soft Quotes
2.13. User Input
2.14. Conditional Execution
2.15. Loops
2.16. Generalizing Your Code
2.17. Scripting an Analysis Pipeline
2.18. Functions and Calling other Scripts
2.19. Alias
2.20. Shell Flags and Variables
2.21. Arrays
2.22. Good and Bad Practices
2.23. Here Documents
2.24. Common Unix Tools Used in Scripts
I. Systems Management
3. Systems Management
4. Platform Selection
5. System Security
6. Software Management
7. Running Multiple Operating Systems

List of Figures

1.1. Hot Keys
1.2. Sample of a Unix File system
1.3. Colorized grep output
7.1. Windows as a Guest under VirtualBox on a Mac Host
7.2. CentOS 7 with Gnome Desktop as a Guest under VirtualBox
7.3. FreeBSD with Lumina Dekstop as a Guest under VirtualBox

List of Tables

1.1. Partial List of Unix Operating Systems
1.2. Pkgsrc Build Times
1.3. Default Key Bindings in some Shells
1.4. Globbing Symbols
1.5. Special Directory Symbols
1.6. Common hot keys in more
1.7. Unix Commands
1.8. Common Extensions
1.9. Standard Streams
1.10. Redirection Operators
1.11. Run times of pipes with cat
1.12. RE Patterns
1.13. Reserved Environment Variables
2.1. Conventional script file name extensions
2.2. Shell Start Up Scripts
2.3. Printf Format Specifiers
2.4. Special Character Sequences
2.5. Test Command Relational Operators
2.6. Test command file operations
2.7. C Shell Relational Operators
2.8. Shell Conditional Operators
2.9. Common Regular Expression Symbols
6.1. Computation Time Line
6.2. Package Manager Comparison

List of Examples

1.1. White space in an Argument
1.2. Simple Pipe
1.3. Filters
1.4. Pushing data with rsync
1.5. Pulling data with rsync
2.1. A Simple Bash Script
2.2. A Simple T-shell Script
2.3. Multiple File Downloads