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
How do I run a .sh file in linux?
Write about an internal command.
What does uname do in linux?
Is makefile a shell script?
How to activate / deploy licence in RHEL 6 and what will happen if you don't activate / deploy licence in RHEL 6 ?
How do you run a command for a limited time?
How do you create a text file in linux terminal?
Write a command that will display all .txt files, including its individual permission.
What is linux load average?
Which of the following tasks cannot be accomplished with the touch command?
What is ulimit command?
What could be the problem when a command that was issued gave a different result from the last time it was used?
How does grep work in linux?
What is df -i command?
What does make clean command do?