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
what is the fastest way to enter a series of commands from the command-line in linux
You wish to print the file vacations with 60 lines to a page. Which of the following commands will accomplish this?
can any one send me one project on linux ...?
How do you insert comments in the command line prompt?
What is iptables command in linux?
What are the commands in linux?
Write a command that will look for files with an extension "c", and has the occurrence of the string "apple" in it.
How do I check storage on linux?
What is the difference between clang and llvm?
You wish to restore the file memo.ben which was backed up in the tarfile mybackup.tar. What command should you type?
What could possibly be the problem when a command that was issued gave a different result from the last time it was used?
What is know about grep commands?
How do you create a blank file in linux?
How can I type in cmd?
What are linux commands?