Skip to main content

All Questions

Tagged with
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 "\&...
cheersmate's user avatar
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 ...
andreee's user avatar
  • 193
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 ...
user394's user avatar
  • 14.7k
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 ${...
rainman's user avatar
  • 149
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), ...
mauek unak's user avatar
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 "*....
sxa144's user avatar
  • 1
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 ...
Livy's user avatar
  • 455
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 ...
roachsinai's user avatar
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 --...
TrevTheDev's user avatar
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: #!/...
vicmarto's user avatar
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 ...
Nik's user avatar
  • 113
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 ...
HarshvardhanSharma's user avatar
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 ...
Vas's user avatar
  • 43
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" ...
Filipe Torres's user avatar
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 ...
Pooja Srinath's user avatar

15 30 50 per page