Question
Linux / Unix Assignment: 1. How many lines in the / etc/passwd file are for neither a student nor a staff member? Here's the algorithm
Linux / Unix Assignment:
1. How many lines in the /etc/passwd file are for neither a student nor a staff member? Here's the algorithm I want you to use to solve this:
- Determine the total number of lines in the file.
- Determine the total number of student entries in the file.
- Determine the total number of staff entries in the file.
- Use arithmetic expansion with the three numbers you obtained in order to determine how many lines are for neither a student nor a staff member.
To summarize, you need four command lines, one for each of the above steps. Be sure to copy/paste all four command lines AND their output.
2. Use arithmetic expansion in a command to calculate and display the number of quarters that would be required if one were trying to minimize the coins needed to give someone $5.67. (Assume the cashier was out of currency!) Then use arithmetic expansion in a second command to calculate and display the number of pennies that would be required if one were trying to minimize the coins needed to give someone that same $5.67.
3. Use brace expansion with the touch command in three command lines to create 365 empty files, one for each day of 2021, in the format ddmmmyyyy, e.g., 25jan2021 and 02feb2021. Here's the algorithm I want you to use to solve this:
- Create one file for the 1st - 28th of each month, all in a single command.
- Create one file for the 29th and 30th of each month except February, all in a single command.
- Create one file for the 31st of each month that has 31 days.
- Use ls to display all the files.
- Display a count of all the files. (The count should obviously be 365--this command is a check to ensure that.)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started