Really need help from 11 on: Create the directory structure IFT383FinalExam/Acti
ID: 3718453 • Letter: R
Question
Really need help from 11 on:
Create the directory structure IFT383FinalExam/Activities/Activity1 in your home directory.
Using the cat command, create a file named classRoster with the following fields, separated by a comma.
Student ID
First Name
Last Name
Grade
Program of Study
ASURITE ID (username)
Add three records to your file.
Display the contents of the file.
Move the file classRoster to the directory Activity1.
Go to the Activity1 directory.
Display the directory you are in.
Add read, write and execute permissions for user and group to Activity1 directory.
Create a new file called header using cat command with the following field names, separated by a tab.
Student ID
First Name
Last Name
Grade
Program of Study
ASURITE ID (username)
Display the file.
Copy the contents of header into classRoster, as the first line
Replace the comma with a tab using appropriate filters (such as cut, paste, tr, head, etc.)
Save this file as finalRoster.txt
Display the contents of the file finalRoster.txt
Explanation / Answer
Hi,
Please find the below commands.
$ mkdir IFT383FinalExam
$ mkdir Activities
$ mkdir Activity1
Using the cat command, create a file named classRoster with the following fields
$ cat > classRoster
123,AA,BB,A+,CSE,DAN
456,DD,EE,B+,ECE,DOL
789,FF,GG,C+,ITI,DISK
Display file
$ cat classRoster
123,AA,BB,A+,CSE,DAN
456,DD,EE,B+,ECE,DOL
789,FF,GG,C+,ITI,DISK
Move the file classRoster to the directory Activity1.
$ mv classRoster ./IFT383FinalExam/Activities/Activity1
Go to the Activity1 directory.
$ cd ./IFT383FinalExam/Activities/Activity1
Display the directory you are in.
$ pwd
/IFT383FinalExam/Activities/Activity1
Add read, write and execute permissions for user and group to Activity1 directory.
$ chmod 775 Activity1
Create a new file called header using cat command with the following field names, separated by a tab.
$ cat > header
StudentID FirstName LastName Grade ProgramofStudy ASURITEID
Display the file.
$ cat header
StudentID FirstName LastName Grade ProgramofStudy ASURITEID
Copy the contents of header into classRoster, as the first line
$ head -1 header | cat > tmp && cat classRoster | cat >> tmp && mv tmp classRoster
$ rm tmp
Replace the comma with a tab using appropriate filters
$ cat classRoster | sed "s/,/ /g"
StudentID FirstName LastName Grade ProgramofStudy ASURITEID
123 AA BB A+ CSE DAN
456 DD EE B+ ECE DOL
789 FF GG C+ ITI DISK
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.