Watch a directory for files with a pecific pattern


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Watch a directory for files with a pecific pattern
# 1  
Old 03-16-2015
Watch a directory for files with a pecific pattern

I dont know if this possible. I need to watch a directory and if any file gets appeneded with a particular entry say, nologin.php, we should get output of that.
# 2  
Old 03-16-2015
Creating a new file in a directory or removing a file from a directory will update the timestamps on that directory. Modifying the data in an existing file in a directory will not cause any visible change to the directory itself.

What operating system are you using? Several operating systems have non-standard methods of monitoring files that might help you efficiently identify files that need to be checked for the particular entry you're trying to find.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell scripting-I need a script which should watch a directory for a file with specific directory

I need a script which should watch a directory for a file with specific directory. If it finds a file in directory, it should search for few specific keyword in the file. if the keyword exists, it should trim string from specific column. The file should be moved to another directory and the a... (8 Replies)
Discussion started by: akashdeepak
8 Replies

2. Shell Programming and Scripting

Remove all files except the subdirectory(without pattern) in a directory

I used rm * and it deleted the files in the directory but gives and error message for unsuccessful subdirectory deletion. "rm: cannot remove 'DirectoryName': Is a directory" I dont want to explicitly get the above error. What are the modifications I have to do in the rm command? (3 Replies)
Discussion started by: duplicate
3 Replies

3. Shell Programming and Scripting

Watch a directory for new files

In Solaris, and other distros without the "watch" command, use the following code watch for files added to a directory. #!/bin/bash while ; do watchdir=/var/tmp newfile=$watchdir/.newer touch $newfile find $watchdir -newer $newfile; touch -a -m $newfile; ... (10 Replies)
Discussion started by: os2mac
10 Replies

4. Shell Programming and Scripting

How to find files in a pattern directory?

Hi, I have more than 1000 directories under one directory (lets says under /home/). Sub directories are like A1 to A100,B1 to B100 etc.. Here my problem is I need to find the files older than 10 days in the directories which starts with A*. I tried some thing like this which is not... (2 Replies)
Discussion started by: shhrikanth
2 Replies

5. Shell Programming and Scripting

How to count the number of files starting with a pattern in a Directory

Hi! In our current directory there are around 35000 files. Out of these a few thousands(around 20000) start with, "testfiles9842323879838". I want to count the number of files that have filenames starting with the above pattern. Please help me with the command i could use. Thank... (7 Replies)
Discussion started by: atechcorp
7 Replies

6. Solaris

Look for distinct files under a directory matching a pattern

Hi, I'm searching for a pattern 'java' under a directory but it is returning all the files containing 'java', but I want to have only distinct files not all. please help (2 Replies)
Discussion started by: b.paramanatti
2 Replies

7. UNIX for Advanced & Expert Users

Watch directory and move specific file extensions

Hi all, This is actually more for my lazyness then anything else, but I think others might find it useful to use as well. Basically this is what I am trying to achieve... In my ubuntu home dir under Downloads is where firefox saves everything by default, now I know that you can manually... (3 Replies)
Discussion started by: STOIE
3 Replies

8. UNIX for Dummies Questions & Answers

copying a pattern of files in one directory into other with new pattern names...

Hi, I have to copy a set of files abc* in /path/ to /path1/ as abc*_bkp. The list of files appear as follows in /path/: abc1 xyszd abc2 re2345 abcx .. . abcxyz I have to copy them (abc* files only) into /path1/ as: abc1_bkp abc2_bkp abcx_bkp .. . (6 Replies)
Discussion started by: new_learner
6 Replies

9. UNIX for Dummies Questions & Answers

script to watch changes on a directory

Hi, everybody I want to know hot to watch changes on a dir, for example if someone changes a file inside it, with an script. I've tried using md5sum and then diff, sadly with no success. I use md5sum for single files, but doesn't work for directories. The idea is take a snapshot with md5sum,... (4 Replies)
Discussion started by: piltrafa
4 Replies

10. Shell Programming and Scripting

Counting files in a directory that match a pattern

I have 20 files in a direcotry like BARE01_DLY_MKT_YYYYMMDD. The MKT differes for all these files but the remaining syntax remains the same for a particular day. If I am checking for today I need to make sure that there are 20 files that start with BARE01_DLY_MKT_20060720. How can I write a... (31 Replies)
Discussion started by: dsravan
31 Replies
Login or Register to Ask a Question