08-29-2012
Need to search for keywords within files modified at a certain time
I have a huge list of files in an Unix directory (around 10000 files).
I need to be able to search for a certain keyword only within files that are modified between certain date and time, say for e.g 2012-08-20 12:30 to 2012-08-20 12:40
Can someone let me know what would be the fastest way to perform this search?
I tried using find . -exec grep -l "searchword" {} \; and it is taking a lot of time to perform the search as it searches within all the files in the directory.
I am not very much familiar with Unix.. Any help you could provide is greatly appreciated. Thanks!
Last edited by methyl; 08-29-2012 at 08:10 PM..
Reason: please use code tags
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
My problem is with the find command. After looking through the forum I've got -
find . -mtime 2 -name "*"
which gives me a list of all the files modified in the last 2 days.
How do I change this to list files modified in the last 2 hours?
Sorry if this question is already on the forum... (4 Replies)
Discussion started by: am97395331
4 Replies
2. Shell Programming and Scripting
I need to find out the last modified time for the files which are older than 6 months. If I use ls -l, the files which are older than 6 months, I am just getting the day, month and year instead of exact time. I am using Korn shell, and SUN OS.
Thanks in Advance,
Kiran (3 Replies)
Discussion started by: kumariak
3 Replies
3. Solaris
Hi ,
I am trying to find out the List of files modified or added aftter installation of any component on SUN solaris box .
But i am not able to do it using ls or find command .
Can somebody help me out ?
Thanks
Sanjay Gupta (2 Replies)
Discussion started by: sanajyg_mnit
2 Replies
4. Shell Programming and Scripting
Hello :D
I am on the shell prompt in a directory, with couple of zip files in it.
How can I
unzip '*.zip' where modified time > 05:00
...please help
Regards
SunnyK (3 Replies)
Discussion started by: SunnyK
3 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have some log files created in the following fashion
Ex:
file name modified date
1) s.log1 01-jan-08
2) s.log2 02-jan-08
3) s.log3 03-jan-08
4) s.log4 04-jan-08
Now I want to have the latest 2 logs and delete the others.
Can you tell me the one liner /... (1 Reply)
Discussion started by: ammu
1 Replies
6. UNIX for Advanced & Expert Users
Hi,
I am currently using the following command:
files=(ls enuCPU??.????.exp ntuCPU??.????.exp)
I need to now change the commmand to store the file names of files that have been modified before datetime equal to say '02/16/2008 20:30:00'
What could I use? (2 Replies)
Discussion started by: edisonantus
2 Replies
7. Shell Programming and Scripting
Hi All
I have a file of format
asdf
asf
first
sec
endi
asdk
rt
123
ferf
dfg
ijglkp (7 Replies)
Discussion started by: mailabdulbari
7 Replies
8. Emergency UNIX and Linux Support
Actually i did modification in a file on server by mistake, now its showing current time stamp, is there any way to set the files modified date and stamp to last modifies time.
Please advice here.Thanks in advance.:b: (7 Replies)
Discussion started by: saluja.deepak
7 Replies
9. Shell Programming and Scripting
Hi ,
I have been trying to write a perl script to do this job. But i am not able to achieve the desired result. Below is my code.
my $current_value=12345;
my @users=("bob","ben","tom","harry");
open DBLIST,"<","/var/tmp/DBinfo";
my @input = <DBLIST>;
foreach (@users)
{
my... (11 Replies)
Discussion started by: chidori
11 Replies
10. Shell Programming and Scripting
I have ~100 text files in a directory that I am trying to parse and output to a new file. I am looking for the words chr,start,stop,ref,alt in each of the files. Those fields should appear somewhere in those files. The first two fields of each new set of rows is also printed. Since this is on a... (7 Replies)
Discussion started by: cmccabe
7 Replies
LEARN ABOUT SUSE
gnome-search-tool
gnome-search-tool(1) General Commands Manual gnome-search-tool(1)
NAME
gnome-search-tool - the GNOME Search Tool
SYNOPSIS
gnome-search-tool [options]
or select Search for Files... from a Main Menu or from the Places menu in a Menu Bar
DESCRIPTION
GNOME Search Tool is a utility for finding files on your system. To perform a basic search, you can type a filename or a partial filename,
with or without wildcards. To refine your search, you can apply additional search options.
GNOME Search Tool uses the find, grep, and locate UNIX commands. The case sensitivity of the search depends on your operating system. For
example, on Linux, the find, grep, and locate commands support the -i option, so all searches are case-insensitive.
For full documentation see the GNOME Search Tool online help.
OPTIONS
--help Show help message
--named=STRING
Set the text of "Name contains" search option
--path=PATH
Set the text of "Look in folder" search option
--sortby=VALUE
Sort files by one of the following: name, folder, size, type, or date
--descending
Set sort order to descending, the default is ascending
--start
Automatically start a search
--contains=STRING
Select and set the "Contains the text" search option
--mtimeless=DAYS
Select and set the "Date modified less than" search option
--mtimemore=DAYS
Select and set the "Date modified more than" search option
--sizemore=KILOBYTES
Select and set the "Size at least" search option
--sizeless=KILOBYTES
Select and set the "Size at most" search option
--empty
Select the "File is empty" search option
--user=USER
Select and set the "Owned by user" search option
--group=GROUP
Select and set the "Owned by group" search option
--nouser
Select the "Owner is unrecognized" search option
--notnamed=STRING
Select and set the "Name does not contain" search option
--regex=PATTERN
Select and set the "Name matches regular expression" search option
--hidden
Select the "Show hidden and backup files" search option
--follow
Select the "Follow symbolic links" search option
--mounts
Select the "Exclude other filesystems" search option
AUTHOR
GNOME Search Tool was originally written by George Lebl (<jirka@5z.com>). Version 2 was written by Dennis M. Cranston (<den-
nis_cranston@yahoo.com>).
This manual page was originally written by Jochen Voss <voss@mathematik.uni-kl.de>. Version 2 was written by Dennis M. Cranston (<den-
nis_cranston@yahoo.com>).
SEE ALSO
find(1), locate(1), grep(1)
gnome-utils 2.27.1 March 16 2009 gnome-search-tool(1)