#!/bin/bash #To TechJunky from Dynamik @ TE ;) echo "=====Large file list=====" > /auditing/homefoldersize.txt grep "/home" /etc/passwd | awk -F: '{ print $1 }' | while read user do echo "###$user###" >> /auditing/homefoldersize.txt find /home/$user -size +100k >> /auditing/homefoldersize.txt done
dynamik wrote: #!/bin/bash #To TechJunky from Dynamik @ TE ;) echo "=====Large file list=====" > /auditing/homefoldersize.txt grep "/home" /etc/passwd | awk -F: '{ print $1 }' | while read user do echo "###$user###" >> /auditing/homefoldersize.txt find /home/$user -size +100k >> /auditing/homefoldersize.txt done >> will append data to a file while > will overwrite the file.
awk --help
dynamik wrote: I've confessed this to several others privately, I'm a real Linux noob. You'll get that awk line by simply entering: awk --help I stumbled across it while googling the best way to enumerate users on a Linux box. That tiny script sadly took me over an hour. I felt like my Linux knowledge was getting a bit rusty (since I never work with it), so I decided to screw around with this to see if I could come up with a solution.