Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

How do you create a text file in linux?

1061


How is grep so fast?

939


Explain the linux ‘cd’ command options along with the description?

895


Which command would you use to create a file system on a new hard drive?

1003


How do I find command history in linux?

937


Brief about the command ff?

1034


How do I change directories in linux command line?

898


How do I check my system performance?

968


why is the tar command used?

991


What is whois command?

1016


How do I clear my run history?

1014


What are linux commands useful?

1005


How do I run a bash script in linux?

938


How do I find hostname in linux?

1022


What is the use of cp p command?

1033