Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

>Suppose you are in the directory a/b/c. d is yet another subdirectory of a. Giv

ID: 3591377 • Letter: #

Question

>Suppose you are in the directory a/b/c. d is yet another subdirectory of a. Give a command that will move you to the directory a/d WITHOUT (!!!) using names b and c.

>Suppose a shell command with the name identical to some built-in command (for example, echo) resides in the directory /bin. How will you use this command (making sure that the built-in version will not be called instead)?

>Give a command that lists (using long option) attributes of the parent directory.

>Give (smallest) patterns representing a) the set of strings of at least 4 characters beginning with a letter and ending with a letter; b) the set of all strings that have at least 3 characters whose last character is not a numeric digit.

>Write a sequence of cut and paste commands (saving the result of each command in a file) that inverts every name in the file shortlist (found in the textbook and in the directory CS615/ch09) and places a coma after the last name (for example, bill johnson becomes johnson, bill).

>Give a command that creates a numbered list of the departments listed in the shortlist (found in the directory CS615/ch09). Use : as the delimiter (between the numbers and departments).

>Create a command line (in the worst case, a sequence of commands) that lists the three largest files in the current directory (names and sizes). You can assume that the directory does not contain subdirectories — just files.

>Give a command line that selects users logged in more than once. (Hint: use command uniq with necessary option(s) as a part of your solution)

Explanation / Answer

>Suppose you are in the directory a/b/c. d is yet another subdirectory of a. Give a command that will move you to the directory a/d WITHOUT (!!!) using names b and c.

Ans. cd ../../d

>Suppose a shell command with the name identical to some built-in command (for example, echo) resides in the directory /bin. How will you use this command (making sure that the built-in version will not be called instead)?

Ans. /bin/echo

>Give a command that lists (using long option) attributes of the parent directory.

Ans. ls -l ..

>Give (smallest) patterns representing a) the set of strings of at least 4 characters beginning with a letter and ending with a letter; b) the set of all strings that have at least 3 characters whose last character is not a numeric digit.

Ans. a) "^[a-zA-Z]..[a-zA-Z]$"

b) "...*[^0-9]$"

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote