+ Reply to Thread
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
      Mentor Kernel_Killer Kernel_Killer's Avatar
    Join Date
    Feb 2002
    Location
    Misery
    Posts
    1,652
    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 08:17 PM. Reason: used ‘QUOTE’ instead of ‘CODE’

  4. #4
      Mentor Kernel_Killer Kernel_Killer's Avatar
    Join Date
    Feb 2002
    Location
    Misery
    Posts
    1,652
    Do you want your while loop only checking the geeko home dir?
    arrogance breeds ignorance

    Screaming Electron, Full of BSD Goodness

+ Reply to Thread

Similar Threads

  1. Total newbie trying to use a proxy
    By Pocket Universe in forum Suse
    Replies: 1
    Last Post: 06-13-2002, 11:30 AM
  2. Replies: 8
    Last Post: 06-04-2002, 03:31 AM
  3. mySQL newbie
    By Vagrant in forum Linux – Hardware, Networking & Security
    Replies: 4
    Last Post: 03-19-2002, 07:42 PM
  4. Newbie Needs help installing programs
    By Nutz in forum Linux – Software, Applications & Programming
    Replies: 5
    Last Post: 09-13-2001, 05:43 PM

Bookmarks

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