LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-29-2011, 04:44 AM   #1
venkatkoorapati
LQ Newbie
 
Registered: Mar 2011
Posts: 4
Blog Entries: 2

Rep: Reputation: 1
how to find the user information..


hi,

how to find the only particular user (usage) of memory information

please help me ..
 
Old 03-29-2011, 07:56 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
You could use a script as such:
Code:
#!/bin/sh
OLDIFS=$IFS
IFS=$'\n'
tempsum=0
totalmem=0
for m in `ps -eo user,rss --sort user | sed -e 's/  */ /g' | awk -F'[ ]' {'print $0'}`; do
  nu=`echo $m|cut -d" " -f1`
  nm=`echo $m|cut -d" " -f2`
  # echo "$nu $nm $nu"
  if [ "$nu" != "$ou" ] && [ $(echo "$nm"|grep -E "^[0-9]+$") ] 
  then 
    if [ "$tempsum" -ne 0 ]; then echo "Printing total mem for $ou: $tempsum"; fi
    ou=$nu
    tempsum=$nm
    let "totalmem += $nm"
  else 
    let "tempsum += $nm" 
    let "totalmem += $nm"
  fi
done
echo "Total Memory in Use: $totalmem/$(free | grep Mem: | awk '{print $2}')"
IFS=$OLDIFS
This script prints out the memory usage for every user just so you know. Hope this helps. Cheers!

Josh

Last edited by corp769; 04-06-2011 at 06:09 AM.
 
Old 04-06-2011, 06:05 AM   #3
venkatkoorapati
LQ Newbie
 
Registered: Mar 2011
Posts: 4
Blog Entries: 2

Original Poster
Rep: Reputation: 1
user information

Hi,

only user information which (processor,Hard Disk memory,RAM)using.

Please help me...

Last edited by venkatkoorapati; 04-06-2011 at 08:25 AM.
 
Old 04-06-2011, 06:08 AM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
Quote:
Originally Posted by venkatkoorapati View Post
Hi,

user information ( processor , Hard Disk memory,RAM ) usage in single shat.
Please help me...
Ok, what do you mean? You need to explain more clearer, and give me more details than just "please help me......"
 
Old 04-06-2011, 06:12 AM   #5
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
You could use top or htop

Kind regards
 
Old 04-06-2011, 06:19 AM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Quote:
This script prints out the memory usage for every user just so you know. Hope this helps. Cheers!
Why don't you link to the webpage and give credit to the creator?

Kind regards
 
Old 04-06-2011, 02:05 PM   #7
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
Quote:
Originally Posted by repo View Post
Why don't you link to the webpage and give credit to the creator?

Kind regards
Because it was in a directory I have of scripts I find on the internet. If I would have been smart enough to keep the reference, I would have done that
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
qmail user information (user deleted) netguy2000 Linux - Server 2 10-07-2008 01:55 AM
How to find out indone information and datablocks information in a file system chaitanya1982 Linux - Newbie 1 09-24-2008 02:58 AM
Find hardware information speederpro Linux - Newbie 10 03-02-2007 06:26 PM
clamd ERROR:Can't get information about user <USER> sailu_mvn Linux - Software 0 12-21-2005 01:49 AM
How to find patch information? grub Linux - Software 1 01-29-2004 01:46 AM


All times are GMT -5. The time now is 06:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration