Sponsored Content
Top Forums UNIX for Advanced & Expert Users Need to search for keywords within files modified at a certain time Post 302693707 by virtual123 on Wednesday 29th of August 2012 02:57:50 PM
Old 08-29-2012
I just executed the below script in the command line and this doesn't seem to work. Please help.
Code:
touch -t 201208271230 /home/n0149941/dummy1 ;touch -t 201208271240 /home/n0149941/dummy2; find .   \( -newer /home/n0149941/dummy1 -a ! -newer /home/n0149941/dummy2 \)  -exec grep -l "023758874" {} \;


Last edited by jim mcnamara; 08-29-2012 at 04:20 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Checking modified time of files

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

Finding out the last modified time for files

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

Finding list of modified files for a particular time duration

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

Unzip files where modified time>05:00 ?

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

deleting files based on file name and modified time

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

Find and store files based on FileName and Modified Time

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

Search a file with keywords

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

Is there any way to set the files modified date and stamp to last modifies time?

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

Perl - use search keywords from array and search a file and print 3rd field when matched

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

Search files in directory for keywords using bash

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
AUTOMOUNT2AMD(8L)														 AUTOMOUNT2AMD(8L)

NAME
automount2amd - converts old Sun automount maps to Amd maps SYNOPSIS
automount2amd auto.map DESCRIPTION
automount2amd is used to convert an old Sun automount maps named auto.map to an Amd map. This perl script will use the following /default entry type:=nfs;opts:=rw,grpid,nosuid,utimeout=600 If you wish to override that, define the $DEFAULTS environment variable, or modify the script. If you wish to generate Amd maps using the hostd (host domain) Amd map syntax, then define the environment variable $DOMAIN or modify the script. EXAMPLE
Say you have the Sun automount file auto.foo, with these two lines: home earth:/home moon -ro,intr server:/proj/images Running automount2amd auto.foo > amd.foo will produce the Amd map amd.foo with this content: # generated by automount2amd on Sat Aug 14 17:59:32 US/Eastern 1999 /defaults type:=nfs;opts:=rw,grpid,nosuid,utimeout=600 home host==earth;type:=link;fs:=/home rhost:=earth;rfs:=/home moon -addopts:=ro,intr host==server;type:=link;fs:=/proj/images rhost:=server;rfs:=/proj/images BUGS
automount2amd does not understand newer Sun Automount map syntax, those used by autofs. SEE ALSO
conv2amd(8),amd(8). AUTHORS
Original author Mike Walker <mike@tab00.larc.nasa.gov>. Script modified by Erez Zadok <ezk@cs.columbia.edu>, Department of Computer Sci- ence, Columbia University, New York, USA. 24 May 1993 AUTOMOUNT2AMD(8L)
All times are GMT -4. The time now is 06:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy