IT 244: Introduction to Linux/Unix
Class 6 Exercise, Thursday, February 13th
When finished: Remember to check with instructor to make sure you are recorded as having completed the class exercise!
Logging in to users
Your Shell
- Determine Your Current Shell
The easiest way to determine your current shell is to use the
ps (process status) command.
ps
The ps command shows all your running processes, including
your shell, bash.
Explore Your Home Directory
Create ex and ex6 Directories
- Make sure you are in your home directory
cd
- If your it244 directory was created and it now exists, then go into it. (Otherwise, we'll need to help you set it up.)
cd it244
- Create an ex directory
mkdir ex
- Go to your ex directory
cd ex
- Create an ex6 directory
mkdir ex6
- Go to your ex6 directory
cd ex6
nano
- Run nano creating a text file named today.txt
nano today.txt
- Practice with nano
Write a few sentences about what you did today.
Use as many of the nano commands, which you see at the bottom of the page, as you can.
The ^ character you see before each letter in the
help menu at the bottom of the page tells you to hold down
the Control key as you type the letter of the command.
Some important commands do not appear in the menu.
Control A will take you to the beginning of the line, Control E will take you to the end of
the line, and Control K will delete the current line.
When you use Control K, the line you deleted is placed in a buffer.
You can get this line back, pasting it in your current position in the file. using Control U.
- Save the file
Control O
After typing this command, the file name will appear at the bottom of the screen.
Hit Enter, to indicate that this is the correct file name.
- Quit nano
Contrl X
- Look at the contents of the file
cat today.txt
script
Stopping the Execution of a Command
- Run a command that cannot finish
To see how this works, we'll try to run ssh using an account on users that
doesn't exist.
ssh foo@users.cs.umb.edu
If you get a message saying the authenticity of host cannot be established, type "yes".
No password you can enter will allow this command to complete, because you are trying to log
into an account that does not exist.
- Abort the program
Control C
This is the only way you can get out.
Command Line Editing Practice
- Type something at the command line
foo bar bletch
- Move to the beginning of the command line
Control A
- Move to the end of the command line
Control E
- Clear the command line
Control U
Use the History Feature
- Retrieve the last command
⇑
- Retrieve the command before that
⇑
- Return to the last command
⇓
Look at a man Page
- Run man on ls
man ls
- Scroll down one screen
Space
- Scroll down one line
Enter
- Scroll up one line
⇑
- Scroll down one line
⇓
- Quit man
q
Experiment with apropos
- Run apropos on the word "link"
apropos link
Use info
- Run the info command on the word "link"
info link
- Display the help menu
h
- Close the help menu
x
- Quit info
q
- Run info without an argument
info
You should see the first page of the info system.
- Look at the file permission entry
m
At the bottom of the screen, you should see the following prompt
Menu item:
Enter the "File" then hit the Tab key, then press Enter.
- Go to the previous node
p
You should see the entry for "Numeric operations"
- Return to the File permissions node
n
- Look at the "Mode Structure" Link
Keep hitting the down arrow until you are on the line with an * and the words "Mode Structure"
Hit Enter
You should see the "Mode Structure" page
- Quit info
q
When finished:
- Remember to check with instructor to make sure you are recorded as having completed the class exercise.
- When you are ready, be prepared to show me:
- Your command line interaction -- in other words, scrolling up in the terminal windows, not just running the history command!
- Any other deliverables specified in the instructions, such as scripts or other files.