What does the following command line produce? Explain each
aspect of this line.

$ (date ; ps -ef | awk {print $1}' | sort | uniq | wc -l )
>> Activity.log

Answer Posted / vijay

There is a syntactical error in the question
The Actual command should be like

$(date;ps -ef | awk '{print $1}' | sort | uniq | wc -l ) >>
Activity.log

Answer::
"date" command gives the date

"ps -ef" -- gives all the process informations

awk '{print $1}'--- cuts the first column in the processes
(which is the usernames)

sort-- sorts all the usernames

uniq-- gives unique usernames
"wc -l" -- gives the total number of users running process

In compact--- The command displays the date and the number
of users(not repeated) who are executing some process.

The result when Activitylog is viwed after the execution
should be like

>>Fri Apr 3 12:48:21 IST 2009
>>38

Is This Answer Correct ?    16 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the fastest way to enter a series of commands from the command-line in linux

530


You wish to print the file vacations with 60 lines to a page. Which of the following commands will accomplish this?

504


can any one send me one project on linux ...?

2360


How do you insert comments in the command line prompt?

764


What is iptables command in linux?

569






What are the commands in linux?

533


Write a command that will look for files with an extension "c", and has the occurrence of the string "apple" in it.

1178


How do I check storage on linux?

529


What is the difference between clang and llvm?

564


You wish to restore the file memo.ben which was backed up in the tarfile mybackup.tar. What command should you type?

526


What could possibly be the problem when a command that was issued gave a different result from the last time it was used?

538


What is know about grep commands?

554


How do you create a blank file in linux?

510


How can I type in cmd?

512


What are linux commands?

543