Question: Use C + + languge to code Implement the ls command to mimic its behavior in the FreeBSD operating system. LS ( 1 ) utility

Use C++ languge to code
Implement the ls command to mimic its behavior in the FreeBSD operating system. LS(1)
utility is used to list directory contents. For each operand that names a file of a type other than a
directory, ls displays its name and any requested associated information. For each operand that options are available:
-A Include directory entries whose names begin with a dot (`.')
except for . and ... Automatically set for the super-user un-
less -I is specified. -D format
When printing in the long (-l) format, use format to format the
date and time output. The argument format is a string used by
strftime(3). Depending on the choice of format string, this
may result in a different number of columns in the output.
This option overrides the -T option. This option is not de-
fined in IEEE Std 1003.1-2008("POSIX.1").
-L If argument is a symbolic link, list the file or directory the
link references rather than the link itself. This option can-
cels the -P option.
-S Sort by size (largest file first) before sorting the operands
in lexicographical order.
-a Include directory entries whose names begin with a dot (`.').
-d Directories are listed as plain files (not searched recur-
sively).
-l (The lowercase letter "ell".) List files in the long format,
as described in the "The Long Format" subsection below.
-s Display the number of blocks used in the file system by each
file. Block sizes and directory totals are handled as de-
scribed in "The Long Format" subsection below, except (if the
long format is not also requested) the directory totals are not
output when the output is in a single column, even if multi-
column output is requested.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!