Programming :: Searching Recursively By Exif Date?
Feb 20, 2010
I have searched diligently but can't seem to find a way to search by exif date. Most of my searches turned up commands to manipulate EXIF data not just search by it. I have found some likely tools but suspect that I don't know enough bash to recursively find a .jpg file by it's exif date. For example, exiprobe and exifgrep look promising (see examples below).
I have made some progress. At first, I couldn't associate the file name with the date given but learned that the "n" option forces each output line to start with the file name. Now, I need to make the command recurse but can't seem to manage it.
halloween_IMG_0965.JPG: JPEG.APP1.Ifd0.Exif.DateTimeOriginal = '2009:10:31 20:58:52
If it helps, I have linked to the man pages [URL]
View 6 Replies
ADVERTISEMENT
Jan 31, 2011
I've tried what feels like at least a dozen different image viewers and I'm still hunting for one that handles viewing by date taken. The trick is that I'd like to just click the jpeg as they come off the camera and then browse through all the photos in the order taken... without having to load them into a photo management application, sort them in their, then start viewing from there. Too many extra steps for too many pictures when you're looking at a collection that is already organized (using the file system, i.e., nested directories) back to 2000. I need (ideally) a viewer where I click the jpeg, then go next next next through them in the order in which they were taken. Does anyone know if this sort of thing exists?
View 6 Replies
View Related
Oct 31, 2010
I have a mess in my photos folder; I want to sort them according to date in EXIF information and rename according to the date (like 001.jpg, 002.jpg and so on).
How can I do this in Linux? I have used ImageMagick for some basic bulk processing tasks before (converting and resizing, etc), is it possible to use it for this task?
View 4 Replies
View Related
Feb 23, 2011
I would like to remove almost all of the Privacy Evading data that a digital camera is generating, such as EXIF DATA. EXIF DATA: Camera Brand, Camera Model, Date taken, Exposure Time, Flash Fired, Focal Length, Location (if you are using iPhone with categorization by location, if enabled), Metering Mode, etc.
May you, please, write a script which does that job for multiple files?Exiv2 seem to reduce more weight than Jhead so I'll use the command exiv2.That's, generally, what I want the script to do:Retrieve the (Modified) date of a file.
View 3 Replies
View Related
Feb 24, 2011
In the Windows world where I came from, Irfanview freeware easily renamed a large folder of JPEG photos by EXIF time & date stamps, appending a unique number if the time and date stamps were the same. Is there an equivalent rename-by-EXIF information batch command in Ubuntu 10.04 Lucid? For example, change (based solely on EXIF information): FROM:DSC_0001.JPG TO:20110224_09:34:56am.JPG
View 9 Replies
View Related
May 5, 2010
I'm a frequent user of grep. I know that I can recursively search a directory using the -r flag:
Code:
// will recursively search all files
grep -r 'some string' *
However, if I want to limit my search to PHP files, the -r flag is suddenly useless:
Code:
// for some reason, this only searches the PHP files in the current dir
grep -r 'some string' *.php
Any good way to recursively search a directory and its subdirs for a string but ONLY look at PHP or HTML files (and possibly TXT files too) ? I'm really hoping for a nice, short command that doesn't involve using an exclude file and which isn't really painful to type. I do this kind of search very frequently and have resorted to either searching EVERY file which is really slow (TAR and ZIP files really slow it down) OR typing repeated commands to search *.php, */*.php, etc.
View 6 Replies
View Related
Jun 28, 2011
I promise I am carefully studying shell use, and much else, but right now I just need the shell instruction to search directories recursively, for files with .swo & .swp extensions, deleting the files as they're found.
View 7 Replies
View Related
May 30, 2010
I did searched you tube but my results were not great.I have 2 books on KernelProgramming.I feel I need if some where I can get a video tutorial which can help me to understand how to develop a Linux Device driver that will be great.I had a look at Greg Kroah Hartmans video lecture of developing patches on ......I have been reading books and a lot of stuff.So I wish if I could get a video lecture that would be better
View 1 Replies
View Related
Jul 29, 2010
Say, I have a header file containing all required includes:
Code: /* global.h */
#include <stdio.h>
#include <unistd.h>
...
#include <dirent.h>
#include <signal.h>
... /* and so on */
I have several modules in a program (*.h *.c files) and in each *.h I include global.h, then they are included in corresponding *.c files. And I receive strange messages from compiler, like a "warning: implicit declaration of function fdopendir", "error: expected declaration specifiers or '...' before 'siginfo_t' ", "error: 'DT_DIR' undeclared..." though these types, functions and constants are all declared in system headers. What does it mean?... Compiler is GCC 4.4.4-2, system is Fedora 13 x86_64
View 9 Replies
View Related
Apr 1, 2010
I work on two hosts, [1] with online ftp access, and [2] without ncftp installed, but with ssh access.
Now I need to recursively upload a folder from [2] to [1]. So I can't use hardfeed - which is for downloading
I think I can use a
find ./orig -exec curl ftp://pinshosting.net
But I'm not so so known with the params of find and curl to get it working recursively.
View 4 Replies
View Related
Jul 12, 2010
I would really like to preserve a file's original modified date and pass it back to the file as the same attribute after a script has worked on it. I get a lot of JPEG files from different places on the Net which I either turn around and upload or burn to disk, and having the "original" date of either download or last mod in a graphics app would be for me, in the long run, a lot more helpful when deciding, for instance, which files to "recycle" or pass on backing up more than once.I've tried doing this on my own every now and then. Where I run into problems is that it appears "stat" and "date" use different formats for date information, and I can't seem to puzzle out how to "translate" one to the other satisfactorily for the latter command.
Just to give an example:
stat foo.jpg |grep Modify gives me
Modify: 2010-07-12 06:28:56.890625000 -0400
Passing that string as-is to date foo.jpg, I get the errordate: unknown option -- 0 and the usual semi-courteous suggestion to Try 'date --help' for more information.Somehow my TexInfo database got screwed up somewhere along the line and info dategives me the short article on date input formats, not the full documentation for the command
View 4 Replies
View Related
Jan 7, 2010
im working on a mini project which basically use a simple database(Database.txt) which displays its information in this format :apple chiku banana
Code:
#!/bin/bash
Title=
[code]....
View 9 Replies
View Related
Feb 26, 2010
I'm a 1st-year CS major and am new to Java. I had a question about importing packages. As I understand it, when you use a wildcard when importing, it will import the classes within the package specified before the asterisk, but none of the subpackages in the specified package.is there a way to include all classes and subpackages recursively with a single line, instead of doing:
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
As I understand it, it doesn't actually cause any bloat in your bytecode, so if it can be done, would there be any disadvantage?
View 4 Replies
View Related
Feb 23, 2011
I am trying to search particular directory which has files with extensions like .html,.mp3,.xml etc I have a list of such files
What I am doing in my script is
for file_name in `find /home/ -name index.html -o -name song.mp3 -o -name help.xml`;
do
if [ $file!='' ]
then
[Code].....
View 4 Replies
View Related
May 18, 2011
I have a file that contains 5 fields and anothen one with two I want to take the value from user and search file1 and if the value exists then write in file2 to the $2 to the line that $1=value
file 1
1:fsdfsd:g:33:fsdf
2:yytgdcf:a:3:sgd
[code]....
View 2 Replies
View Related
Nov 29, 2009
My problem is this:I have a number of directories, all containing files of different name lenghts, including letters, numbers and possibly spaces. I want to recursively rename all of these files, so that only the _last_ 5 digits (not counting the extension) remain. In other words: I want to cut off all but the last 5 digits and not touch the extension.
I've tried to read up on tr, rename (perl version), sed, cut etc. and browsed through some threads here, but so far couldn't quite figure out how to do it.
If someone could point me to the right (standard) CLI tools and syntax.
View 2 Replies
View Related
Jun 15, 2011
I'm making a small script for searching and doing some operations with photos, but I'm kinda stuck on this little function:
Code:
function findallformat {
prefix=""
if [ $1 = -pre ] then
[code]....
That function should find for every file with a certain type; and you can specify a prefix using a "-pre" followed by the prefix that you want to search. The format should be "stackable", so you can use as many types that you want, without repeating the same function on the code.
Example: findallformat -pre IMG_ .JPG .CR2 #That should search files that start with "IMG_" and finishes with .JPG and .CR2. My problem it's that, when I try to use it on the script, it says "bash: syntax error near `token' unexpected `}'"
View 4 Replies
View Related
Nov 10, 2010
I am trying a search for a pattern in the file. I can have any character in the pattern. I am pretty sure I will have $, ", ', ^, ` etc., The Problem I am facing is if I use "" (double quotes) to enclose the pattern, it gives special meaning to $, ^ and " within the string. I have no control over the pattern input. I am getting it from some other file. On the other hand, If I use '' (single quotes) to enclose the pattern, it gives special meaning to the ' (apostrophe) within the string and terminates the pattern prematurely. How do I disable the special meaning these characters have? For example, in perl, I could enclose the pattern within Q and E. Is there an equivalent in grep pattern expression? I could find one in the man page of grep. Is there a solution to this problem?
View 5 Replies
View Related
Aug 3, 2010
I tried searching for tutorials bout could never figure out MVC.
View 13 Replies
View Related
Nov 4, 2010
I've found myself in the situation where I need to create a menu in gnome/kde for a directory structure full of documents.The directory structure looks like this:
Code:
DOCS/
.. REFERENCES/
[code]...
View 1 Replies
View Related
Apr 30, 2010
...and returning the index of the found element in its array.
I have:
for ((i=0; i < ${#array1[@]}; i++)); do
# Read each line of the file test
if [[ $(eval "sed -n '$(($i+1))'p test") == *${array2[0]}* ]]
stuff
I want to find the index of the found substring in array2 and only if it isn't found, move on to the next element of array2. I don't know the size of array2 so that [0] has just got to go.
View 14 Replies
View Related
Oct 25, 2010
My script looks really crap and messy, the logic isn't great and I'm not hugely happy with it. Also it echo's $i instead of an actual IP address (line 10). How to improve this. It basically searches through /var/log/messages for multiple FTP hits and when the hit count is higher than a specific number the IP is added to a config file and ftp is restarted. There are some obvious flaws in my script.
Code:
MAXHITS=0
TOPHITS=`grep "FTP session closed." /var/log/messages* | awk '{print $7}' | sed -e 's/^.*[//' -e 's/].*$//' | uniq -c | sort -nr`
HITNUMB=`echo $TOPHITS | awk '{print $1}'`
IPHIT=`echo $TOPHITS | awk '{print$2}'`
HIGHIP=`echo $TOPHITS | grep $HITNUMB | grep $IPHIT | awk '{print $2}'`
if [ $HITNUMB -gt $MAXHITS ]; then
for i in $HIGHIP;
do
echo $i
sed -i '78s/$/,$i/' /opt/etc/proftpd.conf
/root/ftp restart
done
else
echo "not greater than $MAXHITS"
fi
I'm not even sure what will happen if I get multiple responses for my $TOPHITS. It would be cool if it could search for IP's already blacklisted somehow, it might actually be easier to just create a file with a set of blacklisted IP's or something.
View 14 Replies
View Related
Mar 4, 2010
Suppose i have a file(1.txt) separated by TAB delimiter in a line
1 B AB 2
2 C AB 2
if I need to search for the records having B?? using grep.If i need to perform multiple search like line having "C and AB" or "B and AB"??
View 5 Replies
View Related
Jun 8, 2010
I have a load of emails in my Thunderbird trash folder and some of them (all with a similar subject) I want to extract the email address for them and put in a text file. I have located the trash file but it seems that it is just a big flat file with a concatenation of all my emails in it, varying number of header lines etc etc - ie, something which really doesn't seem to suit awk, sed, grep etc.Does anyone know of any way this might be accomplished, or any third party tools which may help?
View 1 Replies
View Related
Feb 23, 2011
I am trying to search particular directory which has files with extensions like .html,.mp3,.xml etc I have a list of such files What I am doing in my script is
for file_name in `find /home/ -name index.html -o -name song.mp3 -o -name help.xml`;
do
if [ $file!='' ]
then
[code]....
I have around 100+ files name with some particular extension , this code works fine if the directory name does not have any special character in it like " "(white character) .
It is failing to give the output. IF I run the find command on the console the I am getting the correct file name with location
/home/user1/public_html/mediawiki/config/movie.mp3
/home/user1/public_html/mediawiki/movie.mp3
/home/user1/public_html/mediawiki/pop.mp3
/home/user2/public_html/index test/pop.mp3
/home/user2/public_html/index test/web.xml
/home/user2/public_html/song.mp3
If I echo the file name from the script Then output is little missed match when a directory name has special char like " "
/home/user1/public_html/mediawiki/config/movie.mp3
/home/user1/public_html/mediawiki/movie.mp3
/home/user1/public_html/mediawiki/pop.mp3
[code]....
I am not sure what is wrong with script or my code .. Does shell have un-controlled behavior of manipulating the output of any command.
View 14 Replies
View Related
Nov 8, 2010
I want to find maximum length file in a given directory. It should search recursivley. I want this to be done using ls and simple looping constructs.
View 6 Replies
View Related
Jun 3, 2010
I have a directory listing with many subdirectories having many files. I want to recursively search for the oldest 5 files starting from the base directory and not 5 from each subdirectory. I am writing a shell script which sorts them using ls -lRtur|egrep "txt|jpg" > /tmp/file1 Now from this /tmp/file1 file I want to sort the files same as what the ls -ltr command does that is oldest file time to newest file time first. How do I sort based on Linux time stamp? The files itself also have Linux timestamps embedded in them So I can sort based after extracting them as well if it is easier.
My /tmp/file1 has entries like below.
-rw-rw-r--. 1 usr1 usr1 705 2010-01-22 17:25 sample20100603173659.jpg
I want to get the 5 oldest files and then delete them.
View 1 Replies
View Related
Oct 14, 2013
I'm trying to search for several strings, which I have in a .txt file line by line, on another file.
So the idea is, take input.txt and search for each line in that file in another file, let's call it rules.txt.
So far, I've been able to do this, to search for individual strings:
Code: Select allimport re
shakes = open("output.csv", "r")
for line in shakes:
if re.match("STRING", line):
print line,
How can I change this to input the strings to be searched from another file?
So far I haven't been able to.
View 3 Replies
View Related
Feb 25, 2011
Code:
#!/bin/bash
VARR=`cat /proc/asound/cards | grep HDMI | cut -c 1-2`
VARX="defaults.ctl.card $VARR"
VARY="defaults.pcm.card $VARR"
FILE1="alsa"
FILE2="alsa.new"
echo $VARX
echo $VARY
sed "s/defaults.ctl.card*/'$VARX'/g" $FILE1 > $FILE2
This is what I have right now. Well, I thought I knew sed, and apparently I don't... I tried writing this for someone else, and this has given me trouble, so since the user pretty much figured it out on his own, here it goes.
Say VARR=1, so VARX and VARY contain the above text, appended by 1.
What I am trying to do is replace the text "defaults.ctl.card 0" by VARX and "defaults.pcm.card 0" by VARY. The contents of FILE1 is the file being used to search for both text fields, and FILE2 is the output file. I tried using single quotes, double quotes, and a mixture of both, and no go whatsoever. So my question... What is the proper way of searching for text within a file and replacing with a variable?
View 5 Replies
View Related
May 5, 2011
(bare with me as I am sort of new with scripting) I am trying to figure out how to run a script that does a basic chkconfig and to get only those services that are running, but changing the color of "on" to red in my output file. Here is what I am working with so far:
Quote:
#/bin/bash
RED=$(tput setaf 1)
BLK=$(tput setaf 0)
[code]....
*I had to substitute a "-" and <colon_symbol> for ":" in front of the on's, because the forum thought they were smiley faces (i.e. n) how to make the "on" to be red while the rest of everything remains in black text. I have been trying to read up on sed and awk, but it is still pretty much a mystery to me right now. There will be other things in the output file that I wouldn't want a rogue "on" to be in red, so just the instances of "on" in that one chkconfig return.
View 4 Replies
View Related