answer for all quastion and the comand for each quastion on linux
Projects 2 . All answers must be from \( \operatorname{Labs}(5-8) \) only. Question 1: On your system, write the commands to do each of the following and save the number of each question and the answer to a file called Question1_answers. You MUST also take screen captures or images clearly showing the commands you executed on your system for each of the questions below and whatever results were displayed on the screen. The screen captures, or images should be included in sequence in a Word file called Question1 images. Note: Every time, run the clear command before taking a screenshot of your machine terminal. YOUR TERMINAL PROMPT should be clearly shown. 1. Question\#1: Use the find command to compile a list of all directories in your system (under the root'/'directory). The command must redirect the output so that the list of directories ends up in a file called directories.txt and the list of error messages in a file called errors.txt. 2. Question\#2: run vi forever in the terminal and write the following script: while true do echo hi students> out done: wq! 3. Question\#3: Run the command forever in the background using \& . 4. Question\#4: Run the command forever in the foreground, suspend it with CTRL \( +2 \), and put it into the background using bg. Next, run the command jobs, then the command ps. Finally, bring the job back into the foreground with fg. 5. Question\#5: Run the command forever four times in the background using \&, then use the kill command to terminate the process by its job number. Repeat this task but kill the process by specifying its PID.
6. Question\#6: Run the command forever in the background using \( \& \), then use the kill command to suspend (stop)the process. Finally, use the bg command to resume running the process. 7. Question\#7: Suppose there are many forener processes in the background, for example, more than 30 processes in the jobs. We need to kill these processes at once using only the kill command (the terminal mustn't be killed, terminated, or hanged). 8. Question\#8: Create a variable called myprj2var in your current bash shell with value project, then make sture that the variable myprj2var is passed from bash to ksh when you run a \( k \) sh shell under your bash shell. 9. Question\#9: Create a Prj2 directory under your home directory, add the directory to the end of your current PATH environment variable (temporarily) and display the value of the PATH variable on the screen. 10. Question\#10: What is the difference between nice and renice commands? Give a usage example for each of them. Question 2: Using the given prj2_passwd file, use your system to write a single command to do each of the following (Write the number of the question and the answer to a file called Question2_answers). You MUST also take screen captures or images clearly showing the commands you executed on your system for each of the questions below and whatever results were displayed on the screen. The screen captures, or images should be included in sequence in a Word file called Question2 images. 1. Question\#1: Display the login names (eg., u1180111) of all users whose last name is mohammad (all cases) and whose default shell is ash. 2. Question\#2: Display the first names in uppercase of all unique users (all cases) with comp322 as part of their home directory, sorted by the numerical value of their user id numbers in descending order. 3. Question\#3: Select all sh shell usernames (full name, separated by a space in uppercase) and save them to a file called sh_shellusers. 4. Question\#4: Save users from user number \( 15^{\text {th }} \) to user number \( 20^{\text {th }} \) into a user's.txt file. The name in this file should appear in uppercase and sorted in descending order (i.e., first name and last name separated by a space). 5. Question\#5: Display the unique first names of all users (all cases) whose last names end with the letter between a-o, and save the result to the a_oSorted.txt file
6. Question\#6: List the full names (all in uppercase) sorted in descending order of all users whose shell is NOT zsh shell. 7. Question\#7: List the last names of all users (sorted based on ID number in ascending). The user that has a login name starts with u116. 8. Question\#8: Display all files in the (/etc.) directory does not contain word passwd in these files page by page on the screen 9. Question\#9: Display the number of directors in the /etc. The directory starts with any letters (a-k) for all cases. 10. Question\#10: List the initials (i.e., the first letter of the first name followed by the first letter of the last name) of all users with \( k \) sh as their default shell. Submission (on the Linux Server by the due date and time): You must create pri. 2 under your home directory lat Linux server 172.16.2.90 from inside Masri Building using FOIT wireless point). Submit inside this directory the follwoing four documents:
Note: You can use the FileZilla tool OR ftp command as follows ftp 172.16.2.90 (using the same username and password). After logging in, use the command put (from your home directory) put question1_answers.doc (a successful message should be displayed on the screen) Projects that do NOT include the two image files will NOT be graded and will receive a zero grade. You should do all the work above wholly on your own. Working with anybody else in class or others on any part of this project will result in a zero grade. No projects will be accepted after the due date and TIME for any reason