Results 1 to 4 of 4

Thread: Newbie looking for scripting help.

  1. #1

    Newbie looking for scripting help.

    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~

  2. #2
    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.
    arrogance breeds ignorance

    Screaming Electron, Full of BSD Goodness

  3. #3
    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).

    Code:
    For $DIR in /home/* /root
    	do
    		ll -t >> /home/geeko/Proj7/stdout
    		du -hs >> /home/geeko/Proj7/stdout
    	done
    Thanks.
    Last edited by evilspoon; 10-03-2007 at 07:17 PM. Reason: used 'QUOTE' instead of 'CODE'

  4. #4
    Do you want your while loop only checking the geeko home dir?
    arrogance breeds ignorance

    Screaming Electron, Full of BSD Goodness

Similar Threads

  1. GUI Scripting
    By friskydrifter in forum Programming
    Replies: 3
    Last Post: 03-07-2006, 12:08 AM
  2. Perl Scripting
    By CP in forum Linux - Software, Applications & Programming
    Replies: 2
    Last Post: 03-04-2004, 11:39 AM
  3. need some bash scripting help
    By mountainman in forum Programming
    Replies: 2
    Last Post: 08-30-2002, 12:44 PM
  4. Scripting question
    By kenshi in forum Programming
    Replies: 19
    Last Post: 05-30-2002, 08:40 AM
  5. Bash Scripting
    By cuban in forum Programming
    Replies: 3
    Last Post: 09-10-2001, 01:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •