Download 10 Questions in Experiment 5 on Unix Fundamentals | CSCI 2200 and more Lab Reports Computer Science in PDF only on Docsity! CSCI 2200 Lab 5 Name: _________________________________________________ Objectives: Reinforce directory and file commands. Introduce error status redirection Introduce the /dev/null device Introduce grep (fgrep and egrep) for searching for data within files Introduce find and locate for searching for filenames Commands/topics introduced: find, grep, pattern matching, and error message redirection. Tutorial: Some commands include an option to suppress error messages, while others do not. If a command does not provide an option for suppression of error messages, error messages may be suppressed via redirection. You can redirect error messages using the following format: command options parameters 2> /dev/null 2> means to redirect only the error messages and /dev/null is a special file that basically discards all data (commonly called the “bit bucket”). Instructions: Enter the commands to accomplish the following tasks and answer any questions. (use Control-c to terminate the process if it is running too long). Each question worth 1 point. 1. Within the /etc/passwd file display the lines containing your last name Command: 2. Locate all of the files (filenames only, not the lines themselves) within the /etc directory that contain a line with your userid. Please suppress any error messages Command: 3. Locate all of the files (filenames only, not the lines themselves) within the /etc directory with passwd in the filename, that contain a line with your userid. Please suppress any error messages Command: 4. From the /etc/passwd file, list only your last and first names (in any order) using only your userid. Command: 5. From the /etc/passwd file, list only the last and first names (in any order) for all users whose userid’s begin with zm. Command: 6. How many files in the /etc directory contain blank lines (suppress errors). Command: Number of Files: