Use a terminal session to:
- Find the following files and directories:
- The gcc compiler.
- The file that lists all the user groups.
- The directory that is used for print spooling.
Put the full path names in a file called Eureka. (0.75%)
- Write a script called ChangeExtensions that accepts two file
name extensions as arguments, and renames all files with the first
extension to have the second extension.
For example, ChangeExtensions txt text would change all
.txt files to be .text files.
Hint: read the man pages for basename.
The script must check that two arguments have been provided, and exit
with an error message if not.
The script must check if there are any files with the first extension,
and exit with an error message if there are none.
If all goes well, a message must be output for each filename that is
changed.
(1.0%)
- Making files and directories
- Make a directory called LabTask2 off your home directory.
- Off LabTask2, a subdirectory called Originals
- In Originals two files, HardStuff and
SoftStuff (put any garbage in them)
- Off LabTask2, a subdirectory called Links
- In Links
- A hard link named LinkToHardStuff that links to
HardStuff in Originals.
- A relative soft (symbolic link) link named
RelativeToSoftStuff to SoftStuff in
Originals.
Put the commands that you used to do these (including making the
directories and files) into a file named
MakingLinks. (0.75%)
- Create a directory called IveGotRights off LabTask2.
Set its permissions to:
- Read, write, and execute permission for the owner
- Read and execute permission for the group
- Execute permission for others
Put the commands that you used to do these into a file named
Permissions. (0.5%)
Answer