|
|
Introduction to Unix, Part 1
Mimosa
Other MCSR Seminars
Description
Unix is the operating system for cypress, sunset, sweetgum, magnolia, mimosa, cedar, and redwood.
This seminar will give an overview of Unix
and its function in the context of the Internet. The following
topics will be covered: Logging on to the system; Logging off the
system; Changing your password; The UNIX file system;
Understanding commands and processes; The shell; Using UNIX
commands; Looking-up commands in the on-line manual.
Scope
The most recent offering of this seminar was June, 2010, at Jackson State University. The general information presented here will be valid indefinitely; however, the exercises, where present, are only meant to be valid for the date of the seminar. To request another offering of this seminar, please contact the MCSR staff.
Text in red denotes commands to be entered at the command prompt by the workshop student.
Outline
- Getting Started
- Concepts
- Commands
- A few essential UNIX commands
- pwd - print working
directory - print the contents of the
working directory
- ls - list - list
contents of directory
- cd - change directory -
changes the working directory
- cat - catenate - print
the contents of a file
- more - print the
contents of a file ... with scrolling
- cp - copy of a file
- rm - remove one or more
files
- Practice
- Run the workshop setup script
mimosa> /home/appl/mpiworkshop/gounix
- What is your working
directory?
mimosa> pwd
- What files and directories are
in your working directory?
mimosa> ls
- Change your working directory to
be the directory corresponding to your
student number. Confirm your success, and
list the files in your new working
directory.
mimosa> cd workshop
- What is in the file called myfile
?
mimosa> cat myfile
- Make a copy of myfile in the
same directory, and call the new file mynewfile
Confirm your success by listing the files
in your new working directory.
mimosa> cp myfile
mynewfile
mimosa> ls
- Remove myfile
Confirm your success by listing the files
in your new working directory.
mimosa> rm myfile
mimosa> ls
- What is in the file called
goodfile?
mimosa> cat goodfile
- more - Displays text one screen at a time.
mimosa> more goodfile
- Using
UNIX commands
- About
commands
- man - The man command which is short for manual provides in depth information about the requested command or allows users to search for commands related to a particular keyword.
mimosa> man ls
- Where
are commands located?
- echo - Echo's to the screen what you type after echo. Echo is useful for producing diagnostics in command files, for sending known data into a pipe, and for displaying the contents of environment variables.
mimosa> echo $PATH
mimosa> which ls
mimosa> which man
mimosa> man which
- Entering
commands
- Command
substitution
mimosa> date
mimosa> echo The date is
mimosa> echo The date is `date`
mimosa> man date
- Redirecting
standard input and output
mimosa> date > today
mimosa> cat today
mimosa> date >> today
mimosa> cat today
mimosa> date > today
mimosa> cat today
mimosa> echo today
mimosa> mail your-email-address < today
- Connecting
commands together
- who - Displays who is on the system.
mimosa> who
- wc - Short for word count, wc displays a count of lines, words, and characters in a file.
mimosa> wc hello.c
mimosa> man wc
mimosa> wc -l hello.c
mimosa> who | wc -l
mimosa> who | wc -l | wc -l
mimosa> who | wc -l | wc -l | wc -l
- Looking-up
commands in the on-line manual
- For Further Information
|