Question

5. Write a bash command that will display the name of every file on the Linux...

5. Write a bash command that will display the name of every file on the Linux system
whose file contaent contains the string "doug.jones". The command must run in the
background, must redirect standard error to /dev/null, and must redirect standard
output to ~/out.

6. Write a bash command that will kill all of the even-numbered processes associated
with your userid, and no other processes.

7. Write a bash command that will start the program
/home/courses/140u-doug.jones/zombie_maker
as a background process, with standard output redirected to /dev/null.
  
This program will create a zombie process.

8. Write a bash command that will display the process id, parent process id, and wait
channel (search for wchan in man ps) for all zombie processes on the server.
Do not display any additional information.
Here is an example of the type of output your command should produce:

28318 28317 exit

9. Write a bash command that will kill job 1.

10. Write a bash command that will generate a file named
~/cpp_files
that contains the name and absolute path of all files on the system
that contain the line
int main(int argc, char **argv)

The contents of the file ~/cpp_files should be in alphabetical order.
The command you create should run in background, and redirect standard
error to the file ~/stderr.

Homework Answers

Answer #1

Answer 5
*********
find . -type f -print | xargs grep "doug.jones" 2>/dev/null > ~/out

Answer 6
********
ps -u | xargs kill -9

this will kill all the process with related to users but not even numbers , dont know how to find that

Answer 7
*********
bash /home/courses/140u-doug.jones/zombie_maker & 2>/dev/null


Answer 8
********
ps -eo pid,ppid,args wchan

Answer 9
*********
kill %1

We are allowed to do only 4 exercise out of any given.

if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and we can edit and change the answers if you argue, thanks :)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write Linux command lines to do the following: 1. Create a directory with name “yourName_ID” 2....
Write Linux command lines to do the following: 1. Create a directory with name “yourName_ID” 2. Create a file with name “yourLastName.txt” inside the directory created in step.1 3. Write inside the created file exactly the following content (you may use editors such as vim, pico, ….): Linux Lab Lab. ToDo#1 Summer Semester 2019/2020# 4. Display the first 2 lines of the file. 5. Change the permission of the file to read write and execute for owner, groups and others....
CS4315 Operating Systems Lab 2: Linux Processes This lab assignment contains three questions. To submit this...
CS4315 Operating Systems Lab 2: Linux Processes This lab assignment contains three questions. To submit this lab assignment, please use a Word document to include the screenshots and write your answer. 1. Run the following C program, and submit a screenshot of the result. #include <sys/types.h> #include <stdio.h> #include <unistd.h> int main( ) { pid_t pid; if ( (pid = fork()) == 0 ) { printf (“I am the child, my pid = %d and my parent pid = %d\n”,...
Consider the C program (twoupdate) to demonstrate race condition. In this assignment, we will implement Peterson's...
Consider the C program (twoupdate) to demonstrate race condition. In this assignment, we will implement Peterson's algorithm to ensure mutual exclusion in the respective critical sections of the two processes, and thereby eliminate the race condition. In order to implement Peterson's Algorithm, the two processes should share a boolean array calledflagwith two components and an integer variable called turn, all initialized suitably. We will create and access these shared variables using UNIX system calls relating to shared memory – shmget,...
currently the code contacts the server 1 time and exits. Modify the code so that the...
currently the code contacts the server 1 time and exits. Modify the code so that the program contacts the server five times before exiting. /* client.c - code for example client program that uses TCP */ #ifndef unix #define WIN32 #include <windows.h> #include <winsock.h> #else #define closesocket close #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #endif #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #define PROTOPORT 5193 /* default protocol port number */ extern int errno; char...
Goals: Write a program that uses binary files. Write a program that stores records to a...
Goals: Write a program that uses binary files. Write a program that stores records to a binary file. C++ Requirements: Write a program that includes a structure named Part that contains the following fields: name - a character array of 20 elements that stores the name of the part. qty - an integer that stores the number of parts in stock. price - a double that stores the price of the part. Create three Part variables in main, and fill...
write a program that automates the process of generating the final student report for DC faculty...
write a program that automates the process of generating the final student report for DC faculty considering the following restrictions. Consider declaring three arrays for processing the student data: studID studName studGrade The student ID is a random number generated by the 5-digit system in the range of (10000 - 99999). Create a function to assign the student ID generated in an array of numbers. Consider the following to generate the random number: Add the libraries: #include <stdlib.h> #include <ctime>...
In C++ Employee Class Write a class named Employee (see definition below), create an array of...
In C++ Employee Class Write a class named Employee (see definition below), create an array of Employee objects, and process the array using three functions. In main create an array of 100 Employee objects using the default constructor. The program will repeatedly execute four menu items selected by the user, in main: 1) in a function, store in the array of Employee objects the user-entered data shown below (but program to allow an unknown number of objects to be stored,...
1. By convention, how are configuration files separated from regular files? (NOTE: A practical effect of...
1. By convention, how are configuration files separated from regular files? (NOTE: A practical effect of the separation is that they are not displayed by the default version of the ls command)                         a. the prefix "rc" (rc.filename)               c. the extension .cfig                         b. a dot (.) at the beginning                    d. by having the SUID bit set 2. The IP address which is reserved for local loopback (equivalent to "localhost") is:                         a. 255.255.255.0                                   c. 192.168.70.1...
MUST WRITE IN C++ Objective: Learn how to design classes using abstract classes and inheritance Assignment:...
MUST WRITE IN C++ Objective: Learn how to design classes using abstract classes and inheritance Assignment: MUST WRITE IN C++ Objective: Learn how to design classes using abstract classes and inheritance Assignment: In cryptography, encryption is the process of encoding a message or information in such a way that only authorized parties can access it. In this lab you will write a program to decode a message that has been encrypted using two different encryption algorithms. Detailed specifications: Define an...
c++ Program Description You are going to write a computer program/prototype to process mail packages that...
c++ Program Description You are going to write a computer program/prototype to process mail packages that are sent to different cities. For each destination city, a destination object is set up with the name of the city, the count of packages to the city and the total weight of all the packages. The destination object is updated periodically when new packages are collected. You will maintain a list of destination objects and use commands to process data in the list....
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT