Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

UNIX ADMIN REVIEW 1 COMMANDS (How would you write the program in UNIX) 1. Use th

ID: 3742884 • Letter: U

Question

UNIX ADMIN REVIEW 1 COMMANDS (How would you write the program in UNIX)


1. Use the script command to capture the actual command entered and the resulting output in a file named MAJOR_IDS.txt

Write a command that produce a sorted list of ECU ID NUMBERS ( only for every user in /etc/passwd that has a home directory under majors.

Just need to know the command for it)





2. Review the following commands: enscript –Plab02 filename Print specified file on printer lab02 lpstat –o Show all jobs queued for every printer available cancel lab01-12345 Cancel print request with id lab01-12345

Follow these steps to build and test your command to cancel all print requests you own queued on a specified printer.

1. Send two print requests to printer mx1 and two print requests to lab02. Note: Do NOT print to lab printer named lab01 because it will actually print them instead of leaving in queue for this exercise. 2. Use lpstat –o to verify your requests are in the print queue. 3. Write a command that will provide the REQUEST ID only for your print jobs on printer mx1 only. For example, although I have one job queued on each printer, my REQUEST ID list should only contain mx1-49386. Note: Make sure you are not seeing every REQUEST ID instead of just those that belong to you and make sure it is for printer mx1 only. 4. Modify your command to cancel those print requests as follows: cancel `your original command from step 3 above` Note: those are back ticks not apostrophes or quotations. 5. Use lpstat –o to verify all of your requests on mx1 were canceled.

Finally, using the script command to capture the commands and the resulting output in a file named PRINT_JOBS.txt: 1. Use lpstat –o to show current jobs queued on all printers 2. Run the cancel command your built above using printer lab02 instead of mx1 3. Use lpstat –o to show current jobs queued Note: You should not have any print requests remaining.

Explanation / Answer

Answer 1:

Use the script command to capture the actual command entered and the resulting output in a file named MAJOR_IDS.txt

So the Script started, and the file is unixfile and the Script is done.

The syntax for the UNIX script command to capture the actual command and the resulting output is:

script [filename] ,and when the filename is MAJOR_IDS.txt then

script MAJOR_IDS.TXT

Write a command that produce a sorted list of ECU ID NUMBERS ( only for every user in /etc/passwd that has a home directory under majors.

The command for sorting list of numbers is

ls -1 | sort ECU ID NUMBERS

Task: See User ECU ID NUMBERS List

/etc/passwd is only used for local users. To see list of all users, simply use the cat command:

$ cat /etc/passwd

Plab02 filename which Print specified file on printer lab02

lpr printer labo2

lpstat –o Shows all jobs queued for every printer available

lpstat-q

cancel lab01-12345 Cancel print request with id lab01-12345

kill -lab01

1.Send two print requests to printer mx1 and two print requests to lab02.

lpr printer mx1 lpr lab02

2.lpstat –o to verify your requests are in the print queue.

lists status of the LP print services.

lpstat -q

lpstat -q[print queue]

3.REQUEST ID only for your print jobs on printer mx1 only

rlogin hostname-ID

rlogin hostname-printer mx1

4.Modify your command to cancel those print requests

kill-text

kill -lab02

can be used to modify and edit commands

5.Use lpstat –o to verify all of your request

//to verify request in queue.

lpstat-q[mx1]

script PRINT_JOBS.txt //script command to capture the commands and the resulting output file named :

lpstat_q mx1 //using lpstst to show current jobs queued in all printers

kill -lab02 //to run the cancelled command in the using printer lab02 instead of mx13

lpstat-q //to show current jobs queued

Hope this will help you.AllThe best.