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 ex07 directory
mkdir ex07- Go to your ex07 directory
cd ex07Filename Extensions
- Create the text file foo.txt with a text editor
nano foo.txt- Add some text
Save and quit.
- Run cat on the file
cat foo.txtcat prints the file to the terminal.
- Change the extension of foo.txt
mv foo.txt foo.xyz- Open the renamed file with nano
nano foo.xyznano opens the file without difficulty.
nano does not care about the extension.
- Change some text in the renamed file
Save and quit.
- Run cat on the renamed file
cat foo.xyzcat does not care about the extension.Create a typescript File
- Make sure you are in your ex07 directory
pwdIf the result of running this command is not~YOUR_UNIX_USERNAME/it244/ex/ex07where 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 ex07 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.The Hierarchical Filesystem
- Find your current location
pwdYou should be in the ex07 directory inside your ex directory of your it244 directory.
- Go up one level to your parent directory
cd .... means the directory one level up.
- Look at your current location
pwdYou have moved up one level.
- Go to the root directory
cd /- Look at your current location
pwdYou are at the top of the filesystem.
- Look at the directories inside the root directory
lsNotice that the home and courses directories are subdirectories of the root directory.
- Return to your home directory
cd- Look at your current location
pwdYour home directory is inside the directory named home, which is, itself, under the root directory, /.
- Return to the ex07 directory inside your it244/ex directory
cd it244/ex/ex07- Check you current location
pwdFilenames
- Run stat to get some information about the Linux host
stat -f /home- Run stat with grep to learn the largest filename possible
stat -f /home | grep Namelen- Create a file with spaces in the name
touch 'hello there'If you did not put "hello there" in quotes, you would create 2 files, hello and there.
- List the contents of your current directory
lsIt looks like you have created two files.
- Perform a long listing on your current directory
ls -lNow you can see that there is only one file.
- Remove the file you just created
rm 'hello there'- Make sure the file is gone
lsCase Sensitivity
- Create the file foo.txt
touch foo.txt- Look at the contents of the directory
ls- Create another foo.txt file
touch foo.txt- Look at the contents of the directory
lsYou only have one foo.txt file since you can only have one file with a given name in any one directory.
- Create the file Foo.txt
touch Foo.txt- List the files in your current directory
lsYou have two files since, as far as Unix is concerned, foo.txt and Foo.txt are totally different file names.
- Create some new files
touch fOO.txt FOO.txt FOO.TXT- List the contents of your current directory
lsYou should see the files you just created since they have different capitalizations.- Remove all .txt files from your ex07 directory
rm *.txtEnd 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 ex07 directory
cd ~/it244/ex/ex07- Make sure you are in your ex07 directory
pwdIf not, see me.
- Create the script ex07.sh
nano ex07.sh- Write into this file commands from most of the sections above
Copy all the commands from the sections The hierarchical filesystem to Case sensitivity Skip the section Filename extensions.
- Save this file
Save and quit.
- Test the script
bash ex07.shFix any errors you find.
If you have trouble, see me.