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.
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 :)
Get Answers For Free
Most questions answered within 1 hours.