how many users / home capacity over command line
hi everyone,
i want to learn how to do 2 things over command line. first one is,how many users are registered on current operating system. the second one how to learn the capacity of the home directories of these users.. thanks.. |
the basic user database is /etc/passwd - 'wc -l /etc/passwd' would give you the total users but not all are human. As far as the disk usage, du will help there. Also, if you're just interested in # of users with home directories, count 'em, again with wc. If you want something more precise, be more precise.
|
Hi,
Quote:
These links and others can be found at 'Slackware-Links' . |
Here is a short awk program that will extract regular users from /etc/passwd:
Code:
#!/bin/bash Code:
#!/bin/bash getent passwd nobody nobody:x:65534:65533:nobody:/var/lib/nobody:/bin/bash |
thanks for all your help,
i will again write some feedback... i used the dh -f command the get the harddisk overview.. Code:
mfc-falter:~ # df -h to get all registered "human" users, i just opened /etc/passwd file with less command and searched for /home/ directory..the i counted them..as i had maximum 7-8 users on a single machine, counting them manually wasn't really a big problem. anything else, any corrections? |
All times are GMT -5. The time now is 02:11 AM. |