Topic
- Exercise 1
- Create a directory 'test'
- Without changing directories, (ie, from your home dir), create a file in the 'test' directory, 'file1' (empty file).
- touch test/file1
- echo > test/file1
- Change into 'test'. Create a file, 'file2', with the contents 'Hello worllld'.
- cd test
- echo Hello Worllld > file2
- Using input redirection, spell check 'file2' and output the mistakes to 'file2.typos'.
- spell < file2 > file2.typos
- Copy 'file2' to 'file2.copy'. Change the contents of 'file2.copy' to 'Hello world'.
- cp file2 file2.copy
- vi file2.copy
- <make changes, write and quit>
- Spell check 'file2.copy'
- If there are no mistakes, rename ( mv ) 'file2.copy' to 'file3'. Spell check 'file3' and put the results in 'file3.typos'.
- mv file2.copy file3
- spell file3 > file3.typos
- Change permissions of typo files to read for owner, nothing for anyone else (-|r--|---|---)
- chmod 400 *.typos
- chmod 400 file?.typos
- Change the owner of 'file1', 'file2', 'file3' to yourself (your username)
- Change the group of the typo files to yourself (your username)
- chgrp users *.typos
- chown :users *.typos
- Add a few more lines to 'file3' with info about yourself, such as Name, DOB, hobbies, job, etc
- vi file3
- <add lines, write and quit>
- (Give yourself write permissions on file3.typos) Spell check 'file3' again, outputting to 'file3.typos'. Use tee, so you can see if you made any mistakes. If you did, go back to the previous step!
- chmod u+w file3.typos
- spell file3 | tee file3.typos
- Without leaving the 'test' directory, copy file3 to your home directory and name it 'file100'. Do this with a *relative* pathname.
- cp file3 ../file100
- cp file3 ~/file100
- Repeat the previous step, using an *absolute* pathname, and name it 'file101'.
- cp file3 /home/nathan/file101
- Change back to your home directory
- Run 'diff file100 file101' and see if there is any output (there shouldn't be!!!)
- Read the man page for diff