Course Overview
The course would be suitable for anyone who needs to use Unix as a data-processing platform or those who support Unix-based applications and users. It would also give a useful introduction to anyone who needs to learn how to administer a Unix system, although administration is outside the scope of this course.
Skills Gained
- Logon to a Unix system and use the korn shell command interface to run commands and locate and examine files
- Move around the UNIX filestore using full and partial pathnames
- Create, copy and move files and directories
- Secure files and directories using permissions
- Use features of the UNIX shell to combine commands using pipes
- Save the results of commands into a file
- Use features of the UNIX shell to customise their working environment
- Use the find and grep commands to locate information within the UNIX filestore
- Use the sed utility to automate the editing and filtering of files
- Use the awk command to extract information and generate reports for datafiles
Course Outline
Introduction and History
What does Unix do? Why Unix is useful.A brief history of Unix and why there are different flavours of Unix
Basic Unix Commands
Logging-in and entering commands, types of user (user/superuser) and their capabilities, structure of the passwd file and how to read it, some useful identification commands (id/who/who am I), commands, options and arguments - how to create a command-line, listing files, reading files, finding the date and time, logging out
Unix File System Structure
Logical file system, root directory (/), standard Unix directory structure, navigating the directories - the cd command, pathnames (absolute vs relative), creating and removing directories, copying, renaming and deleting files
Unix Shells (Primarily Korn)
Bourne/C/Korn/Bash, general features of interactive shells, command line processing, internal vs external commands, identifying commands with the type command, wildcards and special characters, quoting text and special characters
Editing with vi
Why learn vi? vi modes, vi cursor keys, vi insert commands, vi delete/cut commands, vi copy/paste commands, vi change commands, vi search and replace commands, vi file commands, configuring vi
Shell Configuration
Aliasing commands, command history and command editing, sub(child) shells, environment (aliases/variables/shell options), shell variables (PATH/HOME/PWD/PS1), variables (local/exported), variables and quotes, command substitution, arithmetic substitution, configuration files (/etc/profile, .profile), the ENV variable and .kshrc
Input and Output Data Streams
Unix processes and stdin/stdout/stderr, redirection of stdout, redirection of stderr, redirection of both stdout and stderr, redirection of stdin, here-documents as an alternative to redirection from files, opening additional data streams, using additional data streams
Pipes and Data Manipulation
What is a pipe? Pipes vs redirection, some simple pipelines, some more complex pipelines
Searching for Files and Text
find vs ls for locating files, regular expressions and text searches, using grep and egrep to locate text, introduction to sed and awk to manipulate textual data
File System Security
Directories, I-nodes and data blocks (df), physical file systems vs logical file system, links (hard and soft), permissions in Unix file system, changing permissions and ownership of files
Remote Access to Unix
Using ping to check status of systems, logging into remote systems, copying files to and from remote systems
Basic Shell Scripts
Shell as a programming language, #! (hashbang) header, positional parameters, if/then/else construct, test command, read command, loops (for/while/until)