I was wondering.. if I was to look for 5 different files with a similar path.. the five paths to the file of interest being:
/Users/folder1/exp
/Users/folder2/exp
/Users/folder3/exp
/Users/folder4/exp
/Users/folder5/exp
But I don't want to search for it using an asterisk like so:
find /Users/*/exp
How can I go about this?
Related
1st, I want to cover what this question is not about. There are 100's of articles that talk about how to search for folders with dots within their names. This is not the question. This is about searching for files within a folder that has dots in its name.
Say I have a folder
c:\public\dev\process.ui.help\
I have another folder
c:\public\processuihelp\
I have exact copies of the same files in each folder
help.csproj
help.cs
help.cs has a line in it like
//find this - SearchForMe
if in explorer and I search "SearchForMe", then explorer only returns help.cs from the 2nd folder but not the first. It may be treating the dotted folder names as extensions.
Edit: in the index options, any folders with extensions are automatically being de-selected. If I reselect them and save, they are de-selected again.
Is there any work-around or alternative search?
Why? : In this large development project (10's of projects, 1000's of folders), I am using dotted folder names to organise namespaces without creating a deep hierarchy of folders. Windows allows dotted folder names.
I haven't searched with built-in windows searches for a long time.
I just replicated your situation and tried searching with "Search My Files" and with "Everything", two tools I use frequently and both found both files immediately. Maybe give either or both of them a try and see if they do what you are looking for.
Edit: Everything is by voidtools, search my files by nirsoft, both are freeware.
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.
I'm trying to find files in a log file that are 2 levels deep from the root (eg. /xxx/xxx/xxx.xxx). I tried "find" and maxdepth, mindepth but that was only useful for files in directories. I need to find strings in a file instead and discard any results that are more than 2 levels.
How do I find all files containing specific text on Linux? seems to do what you want. It's unclear to me if you have matches you want to discard if they are deeper that two levels.
In no way do i think i'm an adequate unix administrator but i'm learning. I "cd" into a specific directory and it appears to be empty after i do a "ls". But when i "ll" it says this:
/integration/import$ ll
total 184
What is this total 184? And how do i see these text files. I've never seen anything like this before. super confusing.
My co-worker had originally said this: in the imports folder find the text file containing this order and move it out of the folder/queue.
The below should list the hidden files as well. Usually, hidden files are the one starting with a dot. e.g. .mail or so.
ls -latr /integration/import/
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.