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
Is a command a full sentence?
What is lsof command in linux?
What is tty in linux command?
You read an article that lists the following command: dd if=/dev/fdo bs=512 of=/new what does this accomplish?
What does mkdir mean in linux?
What is bash history linux?
Why is linux cpu usage so high?
What is difference between comm and CMP command?
What is top command in linux?
What the command used for list the contents of your home directory, current directory and all subdirectories?
The command ‘umask -S’
How do I start ms dos?
What does chmod 644 do?
How many commands are there in linux?
What does cd do in linux?