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 ex08 directory
mkdir ex08- Go to your ex08 directory
cd ex08Create a typescript File
- Make sure you are in your ex08 directory
pwdIf the result of running this command is not~YOUR_UNIX_USERNAME/it244/ex/ex08where 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 ex08 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.Hidden Files
- Return to your home directory
cd- Confirm that you are in your home directory
pwd- Look at your hidden files
ls -aThese files configure various settings in your Unix environment.
Startup Files
- Go to my home directory
cd ~ckelly- Look at my "invisible" files
ls -a- Look at the contents of my .bash_profile file
cat .bash_profileThis file runs other files that customize my Unix environment.
- Look at the contents of some of the other files
cat .bashrcWhat you see here may not mean much to you now.
But it will later in this course.Absolute Pathnames
- Go to my course_files/it244_files directory using an absolute pathname
cd /home/ckelly/course_files/it244_filesYou can use this pathname anywhere in the filesystem and will always refer to the same directory.
- Determine your location
pwdNotice that pwd always returns the absolute pathname of your current directory.
- Go to my home directory using an absolute pathname
cd /home/ckelly- Verify that you are in my home directory
pwdTilde ~
- Return to your home directory using tilde ~
cd ~- Determine your current location
pwdYou should be in /home/YOUR_UNIX_ID
- Go to my home directory using tilde ~
cd ~ckelly- Determine your current location
pwdYou should be in /home/ckelly
- Go to your it244 directory using tilde ~
cd ~/it244- Determine your current location
pwdYou should be in /home/YOUR_UNIX_ID/it244.
Notice that, although short, ~/it244 is an absolute pathname and can be used anywhere within this filesystem.The . in a Directory
- Go to your ex08 directory in your it244/ex directory using tilde ~
cd ~/it244/ex/ex08- Look at the entire contents of your ex08 directory
ls -aNotice that you have a . and a .. entry.
The . stands for your current directory.
- Create a file named foo.txt
touch foo.txt- Create a test directory
mkdir test- Enter the test directory
cd test- Determine your current location
pwd- Copy foo.txt from the parent directory into your current directory
cp ../foo.txt .You use . to specify the current directory and .. to specify the parent directory.
- Check that the copy operation worked
ls- Make sure you are in your test directory
pwd- Remove everything from your test directory
rm *- Go back to your ex08 diretory
cd ..- Remove the test directory
rmdir testRelative Pathnames in the Current Directory
- Go to the course_files/it244_files directory in my home directory
cd ~ckelly/course_files/it244_files- Check your location
pwd- List the contents of this directory
ls- Display the contents of fruit.txt
cat fruit.txtSince fruit.txt is in your new current directory, its pathname is simply the filename.Relative Pathnames in a Subdirectory
- List the content of the current directory
ls- List the contents of the dir1 directory using a relative pathname
ls dir1- List the contents of the dir2 directory using a relative pathname
ls dir1/dir2- Display the contents of foo.txt inside dir2 using a relative pathname
cat dir1/dir2/foo.txtRelative Pathnames above the Current Directory
- Go to the dir1/dir2 directory using a relative pathname
cd dir1/dir2- Display your current location
pwd- Display the contents of the course_files/it244_files directory using a relative pathname
ls ../../- Display the contents of the root directory using a relative pathname
ls ../../../../../..Relative Pathnames neither Above nor Below your Current Directory
- Look at the contents of my home directory using a relative pathname
ls ../../../..- Look at the contents of my class notes directory for this course
ls ../../../../public_html/teaching/it244/- Look at the first 10 lines of my notes for today's class
head ../../../../public_html/teaching/common/exercises/linux/intro/exercise_08.htmlEnd 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 ex08 directory
cd ~/it244/ex/ex08- Make sure you are in you ex08 directory
pwd- Create the script ex08.sh
nano ex08.sh- Write into this file the commands you used above
Include Unix commands from the section Hidden files to the section Relative pathnames neither above nor below your current directory.
- Save this file
Save and quit.
- Test the script
bash ex08.shFix any errors you find.
If you have trouble, see me.