Skip to main content

All 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 ...
Antonio's user avatar
  • 193
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=' -...
John Smith's user avatar
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. # ...
markling's user avatar
  • 231
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 ...
Porcupine's user avatar
  • 2,146
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 ...
tmark's user avatar
  • 1
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 ...
zhdason's user avatar
  • 55
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: ...
Howard's user avatar
  • 5,279
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 ...
Dilawar's user avatar
  • 991