develop a single command line to achieve the task required : (a) Print out the n
ID: 3628962 • Letter: D
Question
develop a single command line to achieve the task required :
(a) Print out the number of les in the directory /usr/bin whose names start with
either with c or f.
(b) Print out the long listing (i.e. the kind of information generated by ls -l) of
the largest le (in terms of bytes) in the directory /usr/bin. Make use of the -S
option of ls in your solution.
(c) Perform the same task required by (b), but do not use the -S option of ls, though
you are still allowed to use ls.
(d) Find all the words in the dictionary le /usr/share/dict/linux.words that
contain all four lower-case characters that appear in the word “unix” (i.e. ‘u’, ‘n’,
‘i’, and ‘x’) in alphabetical order (e.g., “inux”).
(e) Print out a list of users who are currently logged into the system. The list must
have no duplicates and must be sorted.
(f) Print the size (in bytes) and the name of the largest le in the directory /usr/bi
Explanation / Answer
a)ls | egrep -c "^c|^f" e)who |uniq|sort f)ls -lrt|sort -nr +5 |head -2 |tail -1
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.