Question: // C (in Linux) // Please code for these questions as soon as possible! It it is clear, I'm going to give you upvote!! Required
// C (in Linux) //
Please code for these questions as soon as possible! It it is clear, I'm going to give you upvote!!

Required compiler flags: -Wall -fsanitize=address, undefined Write a program that searches provided directories and its sub-directories in order to find all the regular files which contain given string in their names. The program should list all found files which satisfy searching criteria with their sizes. The program is run as follows: /prog -p /dir1 -p /dir2 -d 2 -w abc -s 23 -o output. . -p flag is used to provide each directory path . -d flag is used to determine the depth limit of searching. For example if d is 2 and path is ./mainDir then the program should work on ./mainDir, all direct sub-folders of ./mainDir e.g. ./mainDir/dir1, ./mainDir/dir2 but not on sub-folders like ./mainDir/dir2/dira. If d is not specified we should search without depth limit. -w flag is used for specify searching word in files nan names . -s flag is used for specify minimum size of searching files -o flag is used for specify name of output file. If it is not specified we want to print result on stdout otherwise to the given file (overwrite if already exists) Options should be given in described order. Option -p can be given multiple times. If there is no files satisfying given criteria or given arguments are wrong program should write proper message about it. Stages: 1. 5 p. Program works for -d 1 2. 3 p. Option -o works 3. 4 p. Option -s works 4. 5 p. Program works for any -d (also not specified) Copy your solution to a directory: /home2/samba/karwowskij/unix/ The solution was copied to the directory (ticked by the student)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
