All Questions
27 questions
2
votes
2
answers
344
views
find with du -sch and very many files
I have large folder structure and need to get the size of a certain subset. The directories I need to count are defined by having specific subdirectories:
find . \( -iname a -or ... \) -printf "\&...
1
vote
3
answers
2k
views
find: How to efficiently search for big list of filenames
I need to find a few hundred files, where the base names are provided by some list (let's call it baseNames). I then need to search for these base names + three given extensions.
Example: Assume one ...
1
vote
2
answers
664
views
find filenames of one extension that don't have a matching filename of a different extenion
I bought a special digital camera that saves a proprietary image format, which ends in .lri. The company has a desktop program to render .lri files into standard jpg and dng files.
I'm finding that as ...
4
votes
1
answer
449
views
the command find not working with -name option in sh file [duplicate]
I am using the following command to retrieve the number of files which names contains sv or json in a given directory in a remote server:
nbs_files=`ssh -q -i ${sshkey} ${user}@${server} "find ${...
0
votes
3
answers
724
views
find doesn't work when run from remote script
I have following line in a script:
find ~ Templates -maxdepth 0 -type d -empty
which works fine, as expected. However when I copy my script to samba share and run it from there (bash myscript.sh), ...
0
votes
0
answers
401
views
Find and print permissions command in a csh file
Trying to create a .csh file that can find and display permission of the files in the directory.
Using the following content of the script
#!/bin/csh -b
find . type -f \( -name "*.sh" -o -name "*....
0
votes
0
answers
32
views
How to use `find` command with a directory starting with special characters [duplicate]
I am writing a script which takes a directory name from user, then find files inside it. The script may fail if the user use some special characters with their directory name.
$ var="-foobar";
$ find ...
2
votes
1
answer
3k
views
How to add double quotes to zsh function arguments?
I defined a function in .zshrc as follows:
fdtnxg () {
find $1 -type $2 -name "$3" | xargs grep "${@:4}"
}
If I want to use fdtnxg to grep alias mot in all files whose names start with tt. in ...
0
votes
0
answers
104
views
Working with strange filenames [duplicate]
How can the script below be made to always work no matter the filenames returned by find ?
#!/bin/sh
cmds_should_always_work() {
echo "\n\n*********************************" $1
stat --...
1
vote
3
answers
90
views
Characters randomly disappearring from the output of "find"
I'm having a really strange behaviour of find, he is "eating" path characters, can't understand why.
This is using a simple shell script to remux some mp4 files using ffmpeg.
Here is the script:
#!/...
1
vote
2
answers
1k
views
Command to find and combine files matching a complex name pattern
My Linux directory contains a dump of files and they look like:
EDW_Infile_ABC_Daily_Activity_20190204.csv
EDW_Infile_ABC_Daily_Activity.zip
EDW_Infile_PQRInc_Daily_Activity_20190204.csv
...
2
votes
2
answers
655
views
find: exclude n different directories and m different files present at any level but include few files from some excluded directories
I want to recursively find all directories and files inside a path but want to exclude some other directories and files that match given patterns. I then want to execute further commands on the search ...
0
votes
1
answer
278
views
combine find statements
How can i combine both of the below commands? I want to get a single file with the owner and the size of the files
find /test -type f -size +$(df -k /test| awk 'NR == 3 { printf "%d",
$1/4 }') -exec ...
0
votes
1
answer
117
views
Use small script inside another On AIX, or a solution in a single command
I want put on a small script (perl-script.pl) inside another in order to use use it with a find command, like this:
#Saving the previous permission information for a possible recovery.
case "$STAND" ...
2
votes
2
answers
12k
views
Recursively iterate through all subdirectories, If a file with a specific extension exists then run a command in that folder once
I need to recursively iterate through all the subdirectories of a folder.
Within the subdirectories, if there's a file with an extension '.xyz' then I need to run a specific command in that folder ...