All Questions
Tagged with variable-substitution find
8 questions
1
vote
6
answers
232
views
Move a lot of folders with spaces in the name
I have a lot of webpages saved in my Download folder and I want to move all html files together with its folder (for every "NAME.html" exists "NAME_files/" folder).
The big ...
0
votes
1
answer
87
views
How do I correctly define and interpolate this variable into my find command? [duplicate]
I wrote a Bash script, mscript.sh for managing my music files, a part of it creates a list of such files.
all_exts=" -iname \"*.webm\" -o -iname \"*.mkv\" "
#all_exts=' -...
0
votes
1
answer
111
views
Find with optional parenthesised arguments
How to add optional grouped argument lists to find?
For example, using an array of base arguments that define files that will always be found, no matter what other variable conditions are specified.
# ...
0
votes
1
answer
94
views
Find: Substitute expression with a variable
$ find -name "Bik*"
./Biking
./Biking/Unsync/Biking.md.~6~
./Biking/Rendered/Biking.gen.html
./Biking/Biking.md
Now when I substitute expression with a variable as follows:
$ a='-name "Bik*"'
$ find ...
0
votes
2
answers
2k
views
/usr/bin/find invocation doesn't work when used with command substitution [duplicate]
In a script, I have:
CMD='/usr/bin/find /etc -type f -exec /usr/bin/md5sum {} \; '
MD5=$("${CMD}")
But the script gives the error:
-bash: /usr/bin/find /etc -type f -exec /usr/bin/md5sum {} \; : No ...
1
vote
1
answer
1k
views
Error with find when using -newerct values stored in variables
I'm trying to create a bash function that will use a simple file such as
sample.txt
start=22 Mar 2016 10:00
end=22 Mar 2016 12:09
...and find files that I have installed to /usr/local within the ...
5
votes
2
answers
5k
views
Print file name extension using -exec in find
I am playing around with -exec flag of find command. I am trying to use the flag to print the extension name of files, using a fairly new Linux distribution release.
Starting simple, this works:
...
1
vote
3
answers
288
views
Variable scope in multiple pipes
I was trying to do something following,
find . -name "*.dat" | get the basename of file | move filename returned by first command to basename returned by second command
To give a concrete example, I ...