Find linux files with similar names but having different date - linux

I have some files named like this:
aaa-bbb-xxx.ext
aaa-bbb-yyy.ext2
aaa-bbb-zzz.ext3
Some of them are of the same date - then I'm not interested in them. I'd like to find only those files which dates (basically, day of editing) differs. How do I find them? Thank you.
Edit: I forgot to mention - all of files are in the same directory, so there is no need to look up for them on the HDD; the only problem is to make a recognition in the following manner:
1. get 3 files matching the pattern
2. check their dates (day basically) of editing
3. if dates are different, list these files; if the same, ignore
4. continue until all files are checked in the directory

Linux command "Locate"
may help you.

Related

Remove Middle Part of File Name in Linux

I've tried lots and lots of variations using the rename command in the Linux command line and nothing happens when I execute these commands - no errors and no expected outcomes. I've tried using the find command to find files and then rename them with no success. I have files that look like this
201901.cdas1.20190101.pgrbh.grb2flxf06.grb2
201902.cdas1.20190102.pgrbh.grb2flxf06.grb2
and I need them to look like this for the script that is expecting a specific file name format 201901.flxf06.grb2 and 201902.flxf06.grb2.
I need to delete the middle part of the file name with a wild card since there are dates that change in multiple files. The deleted part is this: cdas1.pgrbh.grb2
this is not homework and I've been searching the internet most of the day trying to use different options other than the rename option or a for loop since I get a missing } braces error. Thank you!
Assuming you're using the perl rename command:
rename 's/cdas1\.pgrbh\.grb2//' *.cdas1.20190101.pgrbh.grb2*.grb2

How to use wget to download files that begins with a known expression and have a certain date after some unknown words?

I'm trying to download all files of a specific date of a ftp directory usin wget.
The pathname of these files begins as follows:
ftp://nrt.cmems-du.eu/Core/WAVE_GLO_WAV_L3_SWH_NRT_OBSERVATIONS_014_001/dataset-wav-alti-l3-swh-rt-global-al/2018/10/global_vavh_l3_rt_al_C****_P****_20181002
The problem is that each file has different numbers on the spaces where I put *.
So, I want to skip this part of the pathname and specify only the begining of the filename and the date. I know that it is exactly four numbers after letter C and four numbers after letter P.
I tried using **** or ???? and it doesn't work.
Anyone can help me?
If there is more text after the date in the file name, you need to add a * after the date, like this (not including the full URL here):
global_vavh_l3_rt_al_C*_P*_20181002*.nc
Note that this relies on server-side directory listing (the FTP LIST command). It may not always work because the LIST command can be blocked on the server side, or the server produces output that wget cannot process. (The output format sadly is not standardized.)

How To Recursivley Diff Files With Different Names

I have two directories that I want to compare the contents of. The structure of all the sub-directories underneath the top level directories that I want to compare is the same, but the file names are slightly different. E.g. I want to know if /d1/foo/bar/somefile-v2.txt is different to /d2/foo/bar/somefile-v3.txt.
I've found references that say it should be possible to do this using diff, but I can't find any documentation that tells me how to specify how diff maps from one file name to the other.
What you're referring to is diff's recursive option which in turn will compare all the files in a directory against another.
By reading your comments one can assume that:
File names are different
Using diff alone will not suffice.
You can just write a shell script to take care of this, but to answer your question: No, this can't be done with diff alone.
Note: you can use wildcards for the whole 1 character difference thing but it won't work recursively the way you want it to work.

SublimeText3 - Find all files without a string?

I've looked around quite a bit for an answer to this, but I cannot seem to find what I need. Is it possible with SublimeText3 > Find in Files to do a search for all files that DO NOT include a string?
I've tried toggling the Regular Expressions button beside "Find:" and entering a value, but I'm not a regex pro, so I may be doing it wrong?
For example, I want to find all files in a designated folder that DO NOT have the following string:
social-links
Any help would be greatly appreciated.
Search for all files in your directory in question (for anything, like a space or the letter e...assuming every file has a space or letter e!), and copy all those file-paths to a new file.
Search for all files with the word, and paste that path-list into a second file.
Sort both files, then compare them to see which lines--which paths--are missing from the has-the-word file. Those are the ones you want.
As far as a single find-in-files search, I don't see how you would do that in Sublime or any other basic text editor. Here is some more information:
https://unix.stackexchange.com/questions/26836/how-can-i-find-all-files-that-do-not-contain-a-text-string
Find files that does not contain a string
How to find all files that do NOT contain specific string in windows environment Visual Studio or any other IDE?
Good luck!

SublimeText 2 - find all occurences and save in file

I need to find all occurences of expression in all project files and saved into a separate file. (I need complete list of occurences).
It's possible? (If not, please advice made unpaid simple similar editor with this functionality).
Thanks
You can accomplish this by using Find In Files. Then paste the output in a separate file and save.

Resources