Sponsored Content
Top Forums Shell Programming and Scripting Deleting files using find command Post 302252759 by methyl on Thursday 30th of October 2008 09:01:59 AM
Old 10-30-2008
Please clarify what you mean by the "last file". The order of the output from "find" is not much use for operations based on the age of the file.
If you want to retain the most recently created file, "find" is not the right way.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Deleting files with zero length using ls command

Hi, How can I use ls command to Delete all files with zero length in a given path using ls command (I guess awk is required!)? Thanks. (6 Replies)
Discussion started by: GNMIKE
6 Replies

2. Shell Programming and Scripting

Little bit weired : Find files in UNIX w/o using find or where command

Yes , I have to find a file in unix without using any find or where commands.Any pointers for the same would be very helpful as i am beginner in shell scritping and need a solution for the same. Thanks in advance. Regards Jatin Jain (10 Replies)
Discussion started by: jatin.jain
10 Replies

3. Shell Programming and Scripting

command for deleting log files based on some condition

Hello, Can anyone pls. provide me with the command for deleting files older then 15 days with a restriction to keep at least 5 files in a directory even if they are older then 15 days. Any help will be highly appreciated. Thanks, Pulkit (4 Replies)
Discussion started by: pulkit
4 Replies

4. Shell Programming and Scripting

deleting files inside shell script - ( using find)

Hi, I am using the command find /apps/qualdb/gpcn/scripts/cab_outbound/archive -name 'z*' -mtime +28 -exec rm {} \; in unix command prompt for deleting the files in my unix system under the specfied folder. It was succesfull. But when i running this command inside a shell script name... (2 Replies)
Discussion started by: Jayaram.Nambura
2 Replies

5. Shell Programming and Scripting

Deleting all empty files in sub directories with a command

Hello Friends, Im trying to delete empty files in subdirectories with a command. I can find them checking only one directory in each step and then show them with my command like below moreover i could not add removing part: ls -l */* | awk '{if ($5==0) printf "%3s %2d %s... (5 Replies)
Discussion started by: EAGL€
5 Replies

6. Shell Programming and Scripting

what is the find to command to find the files created last 30 days

what is the find to command to find the files created last 30 days (5 Replies)
Discussion started by: rajkumar_g
5 Replies

7. Red Hat

find . -name '*.req' -mtime +2 -exec rm {} \; not deleting files

i want to remove *.req files from directory /opt/FFCL8001/oracle/inst/apps/FFCL8001_lhrho/logs/appl/conc/log i executed command find . -name '*.req' -mtime +2 -exec rm {} \; but it is running since hours and free space in /opt is same as old 7.4 GB . why it is not removing files ? (5 Replies)
Discussion started by: rehantayyab82
5 Replies

8. UNIX for Dummies Questions & Answers

Crontab deleting files command question

Hello out there, Our system has a pdf generator that creates pdf files. We dont need them pas 120 days. So I have this command in my crontab. I currently set it to "0" for testing. But normally have it set to -mtime 120 to remove files out of the folders from PDF out to several other potential... (7 Replies)
Discussion started by: vsekvsek
7 Replies

9. Shell Programming and Scripting

[Solved] Issue with deleting files through find

Hi, I have a script similar to this #!/bin/ksh cd /orcl/bir/eod_badfiles find ./ -type f -name "*.csv" -mtime +6 -exec rm -f {} \; find ./ -type f -name "*.bad" -mtime +6 -exec rm -f {} \; cd /orcl/bir find ./ -type f -name "*.log" -mtime +6 -exec rm -f {} \; This was working fine in one... (5 Replies)
Discussion started by: Gangadhar Reddy
5 Replies

10. Shell Programming and Scripting

Find command to find a word from list of files

I need to find a word '% Retail by State' in the folder /usr/sas/reports/RetailSalesTaxallocation. When I tried like below, -bash-4.1$ cd /usr/sas/reports/RetailSalesTaxallocation -bash-4.1$ find ./ -name % Retail by State find: paths must precede expression: Retail Usage: find ... (10 Replies)
Discussion started by: Ram Kumar_BE
10 Replies
which-pkg-broke(1)						  debian-goodies						which-pkg-broke(1)

NAME
which-pkg-broke - find which package might have broken another SYNOPSIS
which-pkg-broke package DESCRIPTION
The which-pkg-broke program will retrieve a list of the named package and all its dependencies sorted by the time they were installed on the system (as determined from the mtime information of /var/lib/dpkg/info/*.list . This tool makes it possible for a system admin to obtain information that might correlate installation of package dependencies with a pack- age breakage in order to find which package update might be responsible for the breakage. EXAMPLES
This tool can be useful determine which package dependencies were upgraded more recently and might be associated with the bug that is being observed. For example, if aptitude stops working properly, an administrator can run: $ which-pkg-broke aptitude Package <libapt-pkg-libc6.3-5-3.3> has no install time info libdb1-compat Fri Aug 8 03:02:11 2003 libsigc++-1.2-5c102 Fri Aug 8 05:15:58 2003 aptitude Sun Jan 11 17:38:06 2004 libncurses5 Sun Jan 18 08:11:05 2004 libc6 Thu Jan 22 07:55:10 2004 libgcc1 Tue Jan 27 07:37:22 2004 gcc-3.3-base Tue Jan 27 07:37:31 2004 libstdc++5 Tue Jan 27 07:37:32 2004 So depending on exactly when the misbehaviour started, there may be a reason to point the finger at a more-recently updated library like libstdc++ or libncurses, which are more-recently installed than aptitude itself. SEE ALSO
rc-alert(1) AUTHOR
which-pkg-broke was written by Bill Gribble <grib AT billgribble.com> This manual page was written by Javier Fernandez-Sanguino for the Debian GNU/Linux distribution. debian-goodies July 24 2006 which-pkg-broke(1)
All times are GMT -4. The time now is 02:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy