Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

excluding one folder #77

Closed
splaisan opened this issue Aug 24, 2018 · 7 comments
Closed

excluding one folder #77

splaisan opened this issue Aug 24, 2018 · 7 comments
Labels

Comments

@splaisan
Copy link

splaisan commented Aug 24, 2018

As from #9, could you please provide a find piping example command to exclude the folder donotinclude in a situation like below but processing all the rest recursively. I have tried find but could not make it to exclude it because of -r

Top
--file1
--file2
--subfolder1
--subfolder2
--donotinclude

The --exclude is only for file types and excluding folders would really be nice to have

my curren tcommand for full rhash

rhash -Mr Top -o myhash.md5

@rhash
Copy link
Owner

rhash commented Sep 11, 2018

You should construct file list with find command and pass it to rhash:

find Top -type f -not -regex '.*/donotinclude/.*' > /tmp/file-list.txt && rhash -M --file-list /tmp/file-list.txt

@rhash
Copy link
Owner

rhash commented Oct 6, 2018

Recently I fixed a bug with reading a file-list from standard input.

After the commit b8514dd (fixed again by d10d941) you can use a shorter command:

find Top -type f -not -regex '.*/donotinclude/.*' | rhash -M --file-list -

@splaisan
Copy link
Author

splaisan commented Oct 6, 2018

Thanks you very much for this nice feature and example, now I can use rhash for my data checkup
cheers

@i2324561w2
Copy link

Sorry, I don't know if I should have opened another issue or not.
I don't think it exists a similar command as "find" in Windows, also this way I can't use a relative path, so can you please think again about it?

@satori80
Copy link

@2324561w2, I've been thinking the same thing for a while now.

@rhash
Copy link
Owner

rhash commented Nov 25, 2021

With RHash version 1.4.1 or higher, use Windows DIR and FINDSTR commands:

dir /S /B "C:\THE_FOLDER_TO_SEARCH" | findstr /V /I /C:"\\SOME_SUBFOLDER\\" | rhash -M --file-list -

The \\ sequence in the findstr /C: parameter represents character \. Actually any special character of \.*^$[] must be escaped by \. Check the help findstr output.

@satori80
Copy link

satori80 commented Nov 27, 2021

The --file-list - option doesn't seem to allow for "special" characters:

dir /s /b "“Test file”. whatever.txt" | rhash -H --file-list -
RHash: D:\test\"Test file". whatever.txt: No such file or directory

So, is this a bug in --file-list -, or is it the shell changing the quote style?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants