Be sure to check all the options for ‘ls’, and don’t forget about ‘du’. Of course, since this is for school, I’m not going to give you a full answer, but I’ll give you as many hints as I can.![]()
Hello, I am new to Linux (been using for 1 month) and have just started learning about scripting in a UNIX/Linux class. I understand a little and have wrote a few simples scripts, but am having difficult designing a particular script for class. The script is meant to check each user (including root) directory on that computer and report 2 things:
(1) a Long listing of the user home directory (not the files) to see the rights the owner has.
(2) Disk space used by each user directory includeing sub directory’s.
The script then takes the results and adds them to a file (stdout). The main issue I am havening is figuring out how to make the script check each user’s home directory. If anyone could offer help, advice, it would be appreciated.
Thanks~
Be sure to check all the options for ‘ls’, and don’t forget about ‘du’. Of course, since this is for school, I’m not going to give you a full answer, but I’ll give you as many hints as I can.![]()
I’ve looked around online and have come up with this, I am not sure if it’ll accomplish what I need because I’m not at a machine with Linux installed, I will try in class next time I am there, but in the mean time anyone can tell me if it is wrong? (the output file "stdout" is in the user geeko’s Proj7 directory).
Thanks.Code:For $DIR in /home/* /root do ll -t >> /home/geeko/Proj7/stdout du -hs >> /home/geeko/Proj7/stdout done
Last edited by evilspoon; 10-03-2007 at 08:17 PM. Reason: used ‘QUOTE’ instead of ‘CODE’
Bookmarks