Log in to pe15.
- Run the ssh client
Use the values in the table below to connect to pe15.
ssh configuration parameter value protocol ssh ssh version 2 ssh port 22 host pe15.cs.umb.edu user name your Unix username Authentication method password
- Enter your password
A dialog box will appear on the screen into which you must type the password for your Unix account.
Directory for this Exercise
- Make sure you are in your home directory
cd- Go to your it244 directory
cd it244- Go to your ex directory
cd ex- Create an ex06 directory
mkdir ex06- Go to your ex06 directory
cd ex06Create a typescript File
- Make sure you are in your ex06 directory
pwdIf the result of running this command is not~YOUR_UNIX_USERNAME/it244/ex/ex06where YOUR_UNIX_USERNAME is the name you created for your Unix account, see me.- Run the script command
script --flushThis will create a typescript file in your ex06 directory.
You must perform the remaining steps in this exercise while script is still running.
If you make a mistake, simply try again.
Do not exit the script session until you have finished all the steps in this exercise.file
- Return to your home directory
cd- Run file on the contents of your home directory
file *- Look at the files in my it244_files directory
file /home/ckelly/course_files/it244_files/*Pipes
- Make sure you are in your home directory
cd- Go to your ex06 directory
cd it244/ex/ex06- Make sure you are in your ex06 directory
pwd- Copy red_sox.txt to your home directory
cp /home/ckelly/course_files/it244_files/red_sox.txt .Make sure you include the dot, . , or you will get an error message.
- Make sure the copy operation worked
ls- Find all Red Sox wins
grep Win red_sox.txt- Find all Red Sox wins at home
grep Win red_sox.txt | grep vsHere, the first instance of grep is the source, and the second is a filter.
- Find all Red Sox wins at home, sorted in reverse order by date
grep Win red_sox.txt | grep vs | sort -nrThis is a pipeline, with three separate processes, one for each command.
date
- Show today's date
date- Use the formatting options of date to show today's date using the format YYYY-MM_DD
date +"%Y-%m-%d"which
- Find the executable file for the Python interpreter
which python- Find the executable file for tar
which tarwhereis
- Find files associated with python
whereis pythonNote that whereis reveals many more files.
- Find files associated with tar
whereis tarlocate
- Find all files with "foot" in their name
locate footwho
- Find out who else is logged in to pe15
who- Look at the details of your current session
who am ifinger
- Use finger to see who else is connected to your current host
finger- Use finger on your own Unix username
finger YOUR_UNIX_USERNAMEIn place of YOUR_UNIX_USERNAME, you must put your Unix username.
- Run finger on the first name "Chris"
finger ChrisEnd your script Session
- Exit from your script session
exitYou need to do this or the typescript file will never be created- Look at the contents of the typescript file
cat typescriptBash Script for this Exercise
- Go to your ex06 directory
cd ~/it244/ex/ex06- Make sure you are in your ex06 directory
pwdIf not, see me.
- Create the script ex06.sh
nano ex06.sh- Write into this file all the commands from the sections above
Copy all the commands from the sections file to finger.
Do not call nano inside your script.
- Save this file
Save and quit.
- Test the script
bash ex06.shFix any errors you find.
If you have trouble, see me.