11-07-2000
You can use 'ls -l' to view the date on your files, then use the 'rm' command to remove any that you like. You could also use find, maybe something like:
find . -mtime +5 -exec rm {} \;
which would erase any files not modified within the last 5 days. Check the find man page for more info.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I want to delete all files in a directory which are older than a given date.
I thought of doing it by creating a file by the required date by using touch command. And then i would use find command on that file and try to find files older than that.
I searched the man and found a... (3 Replies)
Discussion started by: rajugp1
3 Replies
2. Programming
I have a number of files of the format filename.xfr_mmddyy_%H%M%S which i get in a specified directory daily. Now i want to search in the specified directory & delete the files which are more than 2 days old .So I use a command
find $DIR/backup/* -ctime +2 -exec rm -f {} \;
But after executing... (1 Reply)
Discussion started by: dharmesht
1 Replies
3. Programming
Hello,
In unix what is the command to delete files created on a particular date.
for example: I have a list of files in a directory
Nov 8 08:30 abc
Nov 8 17:00 xyz
Nov 9 12:30 test
Nov 9 14:45 test2
Nov 9 18:15 quick
Nov 10 07:20 quick2
Nov 11 19:00 quick3
Now i would like to delete... (1 Reply)
Discussion started by: jazz
1 Replies
4. Shell Programming and Scripting
Hi Folks
I am pretty new to unix and shellscripting.
I need help on writing logic on traversing recursively through a set of directories under a top-level folder and delete files(mostly text) which are 1 month old.
Can you people help me on this?
Thanks a lot
Ravi (5 Replies)
Discussion started by: ravi2082
5 Replies
5. Shell Programming and Scripting
I have to write one script which will delete the files in the below passion.
If today is 17-Feb-2010 then the script delete only 17-JAN-2010 files from the directory.
Could you please help me, How will I delete the files when the year is leap year, if today is 30th Mar 2010 then how will... (1 Reply)
Discussion started by: kandi.reddy
1 Replies
6. Shell Programming and Scripting
Hi all,
I've used various scripts in the past to work out the date last week from the current date, however I now have a need to work out the date 1 week from a given date.
So for example, if I have a date of the 23rd July 2010, I would like a script that can work out that one week back was... (4 Replies)
Discussion started by: Donkey25
4 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have number of directories being created under a main directory on daily basis with the sysdate as below
$ pwd
/hello/TEST
$ ls
20111103
20111102
20111101
20111031
20111030
20111029
20111028
20111027
20111026
20111025
20111024
20111023
20111022
20111021 (3 Replies)
Discussion started by: spari2
3 Replies
8. Shell Programming and Scripting
Dear all,
I have 2 questions.
I have a file with many rows which has date of the format YYYYMMDD.
1. I need to change the date to that weeks friday date(Ex: 20120716(monday) to 20120720). Satuday/Sunday has to be changed to next week friday date too.
2. After converting the date to... (10 Replies)
Discussion started by: 2001.arun
10 Replies
9. UNIX for Dummies Questions & Answers
Hi
I have a file:
r58778.3|SOURCES={KEY=f665931a...,fw,221-705}|ERRORS={16_1:T,30_1:T,56_1:C,57_1:T,59_1:A,101_1:A,115:-,158_1:C,186_1:A,204:-,271_1:T,305:-,350_1:C,368_1:G,442_1:C,472_1:G,477_1:A}|SOURCE_1="Contig_1092402550638"(f665931a359e36cea0976db191ff60ff09cc816e)
I want to retain... (15 Replies)
Discussion started by: Alyaa
15 Replies
10. Shell Programming and Scripting
i try to set linux date & time in specific format but it keep giving me error
Example :
date "+%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01"
or
date +"%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01"
keep giving me this error :
date: invalid date ‘19-01-2017 00:05:01'
Please use CODE tags... (7 Replies)
Discussion started by: umen
7 Replies
LEARN ABOUT OPENSOLARIS
gnome-search-tool
gnome-search-tool(1) User Commands gnome-search-tool(1)
NAME
gnome-search-tool - search for files
SYNOPSIS
gnome-search-tool [--named=text] [--path=folder] [--sortby=order] [--descending] [--contains=string] [--user=user] [--nouser] [--allmounts]
[--empty] [--follow] [--group=group] [--hidden] [--mtimeless=date] [--mtimemore=date] [--notnamed=filename] [--regex=pattern] [--size-
less=size] [--sizemore=size] [--start] [gnome-std-options]
DESCRIPTION
The Search for Files application enables you to search for files on your system. Search for Files uses the find(1) command.
OPTIONS
The following options are supported:
--allmounts Select the 'Search other filesystems' search constraint.
--contains=string Select the 'Contains the text' search constraint and set the text of that entry. Use a full filename or a partial
filename with wildcards. See find(1) for more details about using wildcards.
--descending Set sort order to descending. The default sort order is ascending.
--empty Select the 'File is empty' search constraint.
--follow Select the 'Follow symbolic links' search constraint.
--group=group Select the 'Owned by group' search constraint and set the text of that entry.
--hidden Select the 'Show hidden and backup files' search option.
--mtimeless=date Select the 'Date modified before (days)' search constraint and set the text of that entry.
--mtimemore=date Select the 'Date modified after (days)' search constraint and set the text of that entry.
--named=text Set the text of the 'Name contains' search option.
--notnamed=filename Select the 'File is not named' search constraint and set the text of that entry. Use a full filename or a partial
filename with wildcards. See find(1) for more details about using wildcards.
--nouser Select the 'Owner is unrecognized' search constraint.
--path=folder Set the text of the 'Look in folder' entry. Defaults to the current working directory.
--start Automatically start a search.
--regex=pattern Select the 'File matches regular expression' search constraint and set the text of that entry. See find(1) for more
details about the regular expression patterns that can be used.
--sizeless=size Select the 'Size is less than (kilobytes)' search constraint and set the text of that entry.
--sizemore=size Select the 'Size is more than (kilobytes)' search constraint and set the text of that entry.
--sortby=order Sort files by one of the following: name, folder, size, type, or date.
--user=user Select the 'Owned by user' search constraint and set the text of that entry.
gnome-std-options Standard options available for use with most GNOME applications. See gnome-std-options(5) for more information.
EXAMPLES
Example 1: Performing a basic search automatically
example% gnome-search-tool --name=a.out --path=$HOME --autostart
Example 2: Performing an advanced search automatically
example% gnome-search-tool --contains=unistd.h --mtimeless=3 --sortby=size --autostart
EXIT STATUS
The following exit values are returned:
0 Application exited successfully
>0 Application exited with failure
FILES
The following files are used by this application:
/usr/bin/gnome-search-tool Executable for Search for Files
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWgnome-search-tool |
+-----------------------------+-----------------------------+
|Interface stability |Volatile |
+-----------------------------+-----------------------------+
SEE ALSO
Search for Files Manual
Latest version of the GNOME Desktop User Guide for your platform.
find(1), gnome-std-options(5)
NOTES
Written by Glynn Foster, Sun Microsystems Inc., 2003, 2006.
SunOS 5.11 2 Oct 2003 gnome-search-tool(1)