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

Is a command a full sentence?

1056


What is lsof command in linux?

1106


What is tty in linux command?

1040


You read an article that lists the following command: dd if=/dev/fdo bs=512 of=/new what does this accomplish?

1014


What does mkdir mean in linux?

1120


What is bash history linux?

1021


Why is linux cpu usage so high?

1050


What is difference between comm and CMP command?

1039


What is top command in linux?

981


What the command used for list the contents of your home directory, current directory and all subdirectories?

954


The command ‘umask -S’

1021


How do I start ms dos?

929


What does chmod 644 do?

1002


How many commands are there in linux?

1073


What does cd do in linux?

1165