assignment7

docx

School

Washtenaw Community College *

*We aren’t endorsed by this school

Course

120

Subject

Computer Science

Date

Apr 3, 2024

Type

docx

Pages

2

Uploaded by PresidentFlowerAlbatross

Report
Assignment 7 CIS120 For this assignment you use this page to answer the questions shown below. You must do the commands as well. Each answer will follow the question and will be written in blue and bold. 1. Go into your assignments directory. Create a directory within your assignment's directory named "assignment7" write the command you used to do this. mkdir assignment7 2. Using the locate and grep command find all the files that have the word "zip" in them that are located in the /usr/share/man directory. Write the command here. locate /usr/share/man | grep zip 3. Staying in the assignments directory find the job file you created in assignment5 using the "find" command. You are only to look in the assignment 5 directory. You cannot use the word assignment5 you need to use a wildcard. Write the command here. find ~ -name *job 4. Staying in the assignments directory find all the files only in the assignment2 directory that have .txt as their file extension. You cannot use the word assignment2 you need to use a wildcard(s). Write your command here. find a?????????2/ -type f -name “*.txt” 5.Staying in the assignments directory find all the files only in the assignment2 directory that have .txt s their file extension and are greater than 1 kilobyte. You cannot use the word assignment2 you need to use a wildcard(s). Write your command here. find a?????????2/ -size 1k -type f -name “*.txt” 6. Staying in the assignments directory write the command that would find all files within the assignments directory or sub directories that are greater than 1 kilobyte and smaller that 11 kilobytes. Write the command here. find ~ \( -type f -size +1k \) -and \( -type f -size -11k \)
7. Staying in the assignments directory find all the files in your home directory that are greater than 2 kilobytes and output the result in long list format, you cannot use xargs. Write the command here. find ~ -type f -size +1k -ls 8. Do the same thing as in number 7 except this time find all files that are greater than 2 kilobytes and output the result in long list format, only this time you must use xargs. Write your command here. find ~ -type f -size +2k | xargs ls -l 9. On page 253 of the book write the commands to create all the dirlist files make sure they are in your assignment7 directory. Once done write a grep search that will locate all words that start with p in any of the dirlist files only. Write your command here. ls /bin > dirlist-bin.txt ls /usr/bin > dirlist-usr-bin.txt ls /sbin > dirlist-sbin.txt ls /usr/sbin > dirlist-usr-sbin.txt grep p dirlist-bin.txt 10.Do the same thing asked in 9 except this time count all the matches. Write your command here. grep p dirlist-bin.txt | wc 11.Write a grep search that will find all the words that contain the letters a or s or z in the dirlist files only. Write your command here. grep {a,s,z} dirlist-bin.txt 11.Write a grep search that will find all the words that start with "ps" and end with a "d" but can have zero or more characters between "ps" and "d" in the dirlist files only. Write your command here. grep ‘\bps\w*d\b’ dirlist-bin.txt
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help