Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Script to find the files and delete them Post 302597369 by rbatte1 on Friday 10th of February 2012 05:30:54 AM
Old 02-10-2012
Have a look at the find command. Assuming that your users' home directories are all in /home, you could try:-
Code:
find /home -type f | xargs ls -l | sort -bn +4

This will long list off every file (assuming that the user can read all the directories) then sort them on size. Just check that the byte value is indeed in column 5 (skip 4 columns on the sort)

If it just gets too big a list, grow you command to:-
Code:
find /home -type f | xargs ls -l | sort -bn +4 | tail -50

to hopefully just get the important chunk, i.e. the largest 50 files.


Does that help?

If I've missed the point, let me know and I will think again.




Robin
Liverpool/Blackburn
UK
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

A script to find dir, delete files in, and then del dir?

Hello!! I have directories from 2008, with files in them. I want to create a script that will find the directoried from 2008 (example directory: drwxr-xr-x 2 isplan users 1024 Nov 21 2008 FILES_112108), delete the files within those directories and then delete the directories... (3 Replies)
Discussion started by: bigben1220
3 Replies

2. Shell Programming and Scripting

'unexpected token' error using FIND in script to delete old files

Hi, I am compete linux noob, but have managed to setup my Thecus N5500 to rsync to my N5200Pro to do automatic backups each night. The rsync script also moves any files deleted from the N5500 (and previously backed up to the N5200) to a _deleted folder on the N5200 so I can keep them for 30... (10 Replies)
Discussion started by: rpalmer68
10 Replies

3. UNIX for Dummies Questions & Answers

find and delete files

hi all , i want to find and interactively delete all the files having size greater than 20 bytes using "find" and other commands..... (8 Replies)
Discussion started by: sonu_pal
8 Replies

4. Shell Programming and Scripting

find files for a particular date and delete

How can I delete files for a particular date ? I apologize in advance If there is solution please put the link. Thanks, (5 Replies)
Discussion started by: jville
5 Replies

5. Shell Programming and Scripting

Script to find files and delete it by comparing

I have a directory where lot of "gzip" files are dropped in every 5 minutes. There is an application which will process these gzip and move it to another directory but will leave a gzip.out file with lot of output data. I need to remove all the outfiles except for the one which is being... (1 Reply)
Discussion started by: gubbu
1 Replies

6. Shell Programming and Scripting

Perl Script to find the disk usage and to delete the files which is consuming more space

Hi All, I have written a script to check the file system usage and to delete the files which is consuming more space.Please check whether the script is corrcet #Script Starts here #!/usr/local/bin/perl #Program to find the disk space and to delete the older files #Checks the type of OS... (8 Replies)
Discussion started by: arunkarthick
8 Replies

7. Shell Programming and Scripting

Script to go Into Directories and Find/Delete files

I have a task, I usually do manually, but with growing responsibilities I tend to forget to do this weekly, I want to write a script that automates this, but I cant seem to work it out in my head, I have the shell of it out, but need help, and you guys have helped me with EVERY problem I have... (5 Replies)
Discussion started by: gkelly1117
5 Replies

8. Shell Programming and Scripting

Find modify and delete files

hi every one. one of my friends has writen this script and send it to me. this script can find files that add-delete-modify and also send an alert by email i'm not catch all part of it. can anyone explain me how this work #!/bin/bash START="a.txt" END="b.txt" DIFF="c.txt" mv ${START}... (4 Replies)
Discussion started by: nimafire
4 Replies

9. Shell Programming and Scripting

Find command to delete the files

Hi All, I've created 2 files touch -t 201309101234 aa10 touch -t 201309111234 aa11 Exact 60 days before from today date is SEPT 12th . As per the following command as i gave +60 means the files which were created before sept12th should be deleted find /etc/logs/*aa* -type f -atime +60... (5 Replies)
Discussion started by: smile689
5 Replies

10. Shell Programming and Scripting

Script needed to delete to the list of files in a directory based on last created & delete them

Hi My directory structure is as below. dir1, dir2, dir3 I have the list of files to be deleted in the below path as below. /staging/retain_for_2years/Cleanup/log $ ls -lrt total 0 drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2 drwxr-xr-x 2 root ... (2 Replies)
Discussion started by: prasadn
2 Replies
ABRT-DUMP-OOPS(1)						    ABRT Manual 						 ABRT-DUMP-OOPS(1)

NAME
abrt-dump-oops - Extract oops from FILE (or standard input) SYNOPSIS
abrt-dump-oops [-vusoxtm] [-d DIR]/[-D] [FILE] DESCRIPTION
This tool creates problem directory from, updates problem directory with or prints oops extracted from FILE or standard input. OPTIONS
-v, --verbose Be more verbose. Can be given multiple times. -s Log to syslog -o Print found oopses on standard output -d DIR Create new problem directory in DIR for every oops found -D Same as -d DumpLocation, DumpLocation is specified in abrt.conf -u PROBLEM Save the extracted information in PROBLEM directory -x Make the problem directory world readable. Usable only with -d/-D -t Throttle problem directory creation to 1 per second -m Print search string(s) for abrt-watch-log to stdout and exit SEE ALSO
abrt-watch-log(1), abrt.conf(5) AUTHORS
o ABRT team abrt 2.1.11 06/18/2014 ABRT-DUMP-OOPS(1)
All times are GMT -4. The time now is 01:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy