General :: Regex - Using Find To Locate Filenames Before A Certain Date?

Jul 11, 2011

I have a ton of files that are timestamped directories. These all look like2011-06-24_13.53.36 // a directory name for june 24th, 1:53:36 pmI have thousands of these directories. I want to do operations on some of the older ones. Let's say I give it a string for date time that matches that exact format, like i'll give it2011-06-25_00.00.00 // june 25th, 12amI want to find all the directories BEFORE my time. So if i give the string for 12am on june 25th, i want to find all the directories before then.If not i can find EVERY directory i have like this and then filter after wards. The created/modified dates are not tied to the actual timestamp im looking for (that would make this easier)

View 2 Replies


ADVERTISEMENT

General :: Bash - Using Find Or Grep To Locate Filenames With Accented Characters From A Different Encoding System (Windows)

Dec 6, 2010

I tried to tag late onto a question similar to mine on stackoverflow (Find Non-UTF8 Filenames on Linux File System) to elicit further replies, with no luck so far, so here goes again... I have the same problem as the OP in the link above and convmv is a great tool to fix one's own filesystem. My question is therefore academic, but I find it unsatisfactory (in fact I can't believe) that 'find' is not able to find non standard ascii characters.

Is there anyone out there that would know what combination of options to use to find filenames that contain non standard characters on what seems to be a unicode FS, in my case the characters seem to be 8bits extended ascii rather than unicode, the files come from a Windows machine (iso-8859-1) and I regularly need to fetch them. I'd love to see how find and/or grep can do the same as convmv.

[Code]....

View 2 Replies View Related

General :: Automatically Appending Date To Filenames Of Photos Imported Using Shotwell Or F-spot

Nov 26, 2010

Is there a way to automatically append date to the filenames of the photos imported using shotwell or f-spot?

View 9 Replies View Related

Programming :: Php Scripts Cant Locate Filenames With Spaces?

Apr 13, 2011

I have a fresh dedicated server that im currently configuring and needed a little help if I may ask.The problem is that i'm having a file naming issue. for example from the web I can access any file that does not have spaces of any type. ex/music/musicfile.mp3this works fine and my php script can locate itBut the problem is when I try to access a file that has spaces.ex/music/The Eagles - Hotel California.mp3my php script can't seem to locate any files like this with spaces but doesn't have a problem locating the files with no spaces.

I also took a look at the directory within shell. I did notice that files that have spaces are showing up in this formatt in shell.#/home/~username/public_html/music/The Eagles - Hotel California.mp3In shell , i'm assuming that unix/linux maybe adds a backslash before spaces. But when I FTP to this same directoy, the filename look normal and at windows standard. how could I correctly access these types of files within my php scrits? or would I need to have all uploaded files renamed so that spaces are replaced with underscores maybe?

View 4 Replies View Related

Fedora :: Create Filenames Using The Date

May 5, 2010

I am currently working on a script which makes regular backups of some data I have, and I would like to name the compressed TAR files with the date it they were created, in short I want to rename a file:

OriginalName.tar.gz --> AnotherName-30-05-2010.tar.gz

Is there an easy way I can accomplish that? How?

View 14 Replies View Related

General :: Regex To Find Min / Max Length Words In File?

Jan 29, 2011

i am trying to find all 3 and 4-character length words in my file (which is huge and has alot of entries in it, a big fat wordlist!).My attempt with this regular expression (which I thought should work, found something on length search here: [URL]

cat sorted_noapostrophe.txt| grep '.{3,4}'

but it returns no results? Also to find any words starting with 'f' which are between 3 and 5 characters (inclusive) long, how can this be done?

View 4 Replies View Related

General :: 'find' Command Regex To Exclude Hidden Files?

Jun 28, 2010

I have the following command which finds all files that have changed in the last day and lists them. How can I exclude hidden files like .bash_history?

View 3 Replies View Related

General :: Different Between 'locate' And 'find'?

Oct 14, 2010

Why there are two so similar command in Linux? and normally what are the circumstances to use each of them?

View 2 Replies View Related

General :: Find Command In Locate Pdf Files?

May 25, 2010

My goal is to find all pdf files on a remote machine, so I resort to the useful command find. So I type find .pdf or find .pdf" and I get nothing. I do the same on my machine and I get nothing. I do a regular search from the menu on my machine and I find quite a few pdf files. Would somebody please tell me what am I doing wrong?

View 5 Replies View Related

General :: How To Find Installation Date Of OS?

Oct 22, 2010

How would i find the installation date of my OS.

View 5 Replies View Related

Programming :: Find With A Regex Path?

May 5, 2010

I'm using bash scripting to find any file that matches a path governed by the following regular expression:

"(monthly|nightly).[0-9]+/home/(user1|user2)/.mailbox/"
to match files like:
monthly.9/home/user1/.mailbox/l23131564
nightly.15/home/user2/.mailbox/cur/6546213

I've tried:

Code:
myRegex="(monthly|nightly).[0-9]+/home/(user1|user2)/.mailbox/"
find ./ -regextype posix-egrep -regex $myRegex

and it just spins and never gives me an answer, even though the file structure isn't that big.

View 8 Replies View Related

General :: Find Files In Date Range?

May 31, 2010

ls -l /tmp/empty_file*
-rw-r--r-- 1 root root 0 2010-05-30 08:00 /tmp/empty_file
-rw-r--r-- 1 root root 0 2010-05-30 12:00 /tmp/empty_file1

This looks good, the files expected to be seen are output: find /usr ( -newer /tmp/empty_file -a ! -newer /tmp/empty_file1 ) -print

But this shows me files that should not be output and likewise when I replace ls with tar it is tarring a whole bunch of stuff I do not want: find /usr ( -newer /tmp/empty_file -a ! -newer /tmp/empty_file1 ) -exec ls -l {} ;

In the end I would like to replace the "ls" with "tar cvvfp some.tar {} ;", but can't figure out what is going wrong here.

View 2 Replies View Related

General :: Find And Sort Results By Date Modified

Jun 7, 2011

so I was wondering how I could do a simple find which would order the results by most recently modified. Here is the current fine I am using. (I am doing a shell escape in php, so that is the reasoning for the variables. find '$dir' -name '$str'* -print | head -10

How could I have this order the search by most recently modified. (Note I do not want it to sort 'after' the search, but rather find the results based on what was most recently modified)

View 4 Replies View Related

General :: Finding Files Based On Date Without Using `find`?

Aug 11, 2011

I know find can do what I am looking for, but I am wondering if there is an alternative way to find files on the filesystem either created before/after a certain point, or at a certain time.

Typically I rely on updatedb & locate for most of my file searching needs. Issues with those tools, though, are that it only has directory and file names, and it only creates a database of local directories, not anything mounted via CIFS|NFS or via -o loop (eg, .iso images).

So if I need to find files created after yesterday across the entire system (local and remote filesystems), I am currently needing to use find.

What other tools, if any, would accomplish this in a similar fashion?

I have tried ls and grep, but that requires (in my attempts so far) multiple searches:

ls -lR | grep Aug | grep 10
ls -lR | grep Aug | grep 11

View 6 Replies View Related

General :: Find All Files Modified In Date Range

Apr 30, 2010

I need to know all files modified within a date and time range.E.g: All modified files between 20 April 2010, 1100-1200 Hrs."find / -mtime +10 ! -mtime +11" :: this i found for date but how to include time as well.

View 2 Replies View Related

Programming :: Find A Proper Regex To Match The Two Numbers?

Nov 10, 2010

am trying to find a proper regex to match the two numbers in the following log entry.

Code:
15:08:16.142 INF Found 64468
15:08:16.142 ERR [Uniform test code=64469]

Basically the pattern I'm looking for will match the two different numbers spanned across two lines.Thought I need to use multi-line mode as follow but this doesn't match on [URL]...

Code:
/^($[0-9]{5}
[0-9]{5})$/m;

View 6 Replies View Related

General :: BASH To Find Pics And Videos With No Date Taken Exit

Aug 7, 2011

Is there a script to do this? I have shotwell and want to find files that are going to cause problems with automatic sorting.

View 3 Replies View Related

Software :: Use Regex Or Pcre To Find Out The Matched From Multiple Textfiles?

Feb 7, 2010

I am trying to use regex or pcre to find out the matched from multiple textfiles. how to write a relative program on linux C?

View 3 Replies View Related

General :: Offline Method Required To Find Out Number Of Days Since A Certain Date?

Dec 13, 2010

What offline method is there of finding out days since a certain date. Example: How would someone find the number of days from 1-Jan-2003 to 7-Dec-2010? Could someone write a script that takes in the 2 dates and output the number of days?

View 5 Replies View Related

Ubuntu :: Find Command For Multiple Filenames Stored In List?

May 3, 2011

I searched the forum and didn't find any threads that seemed to answer this question. I have a large directory of files, and dozens of subdirectories on a remote box I have ssh access to. I need a subset of these files copied to another folder.

Example:

directories
parent
-sub1
-sub2
-sub3

files I want (the files are all the same format, but some have extensions and others dont)
1100
1215
1322
1442
1500
1512

Unfortunately, I need a lot of files, and plan to do this on a regular basis (the files I need will be different each time) I was thinking it would be nice to be able to put the filenames in a text file (one filename per line) and use the find command to copy the files (I don't necessarily know which subdirectory the file will be in).

[Code]...

View 2 Replies View Related

Programming :: Java Regex - Use Regular Expressions Find Out What The First Two Characters Of The String Are

Feb 2, 2011

What I am doing is reading the text from a text document and storing all of the text inside of a ArrayList. I then set one of the values of the Arraylist as a string. I want to use regular expressions find out what the first two characters of the String are. if first two characters = "//" then function(); I only care about the first two characters though. If you need any more information, just ask.

View 4 Replies View Related

General :: Find A Proper Command To Move A Certain Set Of Files According To Date/time Range?

Mar 18, 2009

I'm trying to find a proper command to move a certain set of files according to date/time range. I am thinking that the command should be something like:

Code:
ls -l | grep 'date/time range' | mv /folder

View 6 Replies View Related

Software :: Bash - Rename Filenames With Corresponding Filenames?

Dec 1, 2009

I got a filename called like this:

beach---------20090808-110000.ogg
beach---------20090808-120000.ogg

It's like this:

name----------YYYYMMDD-hhmmss.ogg

Now Im splitting these hourly files into 1 minute files. I get then this output sofar properly:

beach---------20090808-110000_00.mp3
beach---------20090808-110000_01.mp3
beach---------20090808-110000_02.mp3
and so on....

the 00, 01, 02 and up are the minutes it has splitted it. Now I need a script, after it did this, to rename the file names into this:

beach---------20090808-110000.mp3
beach---------20090808-110100.mp3
beach---------20090808-110200.mp3
beach---------20090808-110300.mp3

View 4 Replies View Related

Red Hat / Fedora :: How To Find / Locate It

Apr 9, 2010

I would like to know if I want to vi /proc/sys/net/ipv4/ip_forward, but assume that I don't know the path of ip_forward, is there a way to tell where is it?

View 3 Replies View Related

General :: Use Date With Touch To Create New File With Date Based Name?

Mar 12, 2010

I am using CRON to create a new, blank file, every minute, in a specific location on my web server. After web searching, and reading man pages, I get the impression that the following command is supposed to work:touch /home/mydomain/var/folder/attachments/`date +%H%M`.txtThis should give me a new file with a file name that is the current hour and minute.However, when executed, the CRON mailer reports:touch /home/mydomain/var/folder/attachments/`date +/bin/sh: -c: line 0: unexpected EOF while looking for matching /bin/sh: -c: line 1: syntax error: unexpected end of fileSo, it looks like shell is seeing the plus (+) sign as an EOFObviously, nothing get created.What would be the easiest, single line command to create an empty file, at a given location, with a time based file name

View 5 Replies View Related

Ubuntu :: Locate And Run Using FIND Command?

Feb 23, 2010

I was trying to find and run the program from command line like calculaterbut i was unable to do these two thing togethet.i can find the path seperetly or i can find and run the program without seeing the pathI want to find and see the path and run it at the same time?

View 6 Replies View Related

General :: Julian Date Converter To Gregorian Date

Apr 22, 2010

Anyone have a ksh solution to convert julian date to gregorian date?

View 6 Replies View Related

Slackware :: Neither Grep Nor Locate Find Khelper - What Does It Do

Jun 21, 2011

Kernel 2.6.21.5, Slackware 12.0

Just after the booting process is finished, running ps I get this:

Code:

As you can see, there are a lot of names beginning with the letter 'k'. Are these processes needed for the GUI to be fully functional when it is run (X Window System + WM + Xfce4)? And can I setup the system such that they're never run?

The reason for this question is that I am testing some programs and need the CPU to have as little time stolen as possible.

View 4 Replies View Related

Ubuntu :: Find Out The Last "up-to-date" Date For "Update Manager"?

Jul 31, 2010

When I clall the "update manager" it tells me if my system is up-to-date or new updates are available. Lets assume I update my system now (I disabled automatic updates).

Then (in a couple of days or weeks) I start the Update Manager again and it tells me again that new updates available. How can I find out now when the last time was when my system was "up-to-date" (=when a complete, successful update took place)?

Is there soemwhere an entry which shows this date?

View 1 Replies View Related

Ubuntu :: Find Programs Installed On Specific Date

Sep 4, 2010

Is it possible to find programs that were installed on a specific date or within a specific date range? If so, how?

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved