Skip to main content

All Questions

Tagged with
0 votes
2 answers
40 views

find script to sort subtree into most recent modification times?

What is the find script to sort a subtree into files with the most recent modification time? Also preserving their path name? I suspect it has something to do with find, ls, awk and sort. I haven't ...
atod's user avatar
  • 49
3 votes
2 answers
106 views

Build find command from arguments in a POSIX compliant shell script

I'd like to know if it's possible to write a POSIX compliant script that builds a find command from its arguments. The way to do it for Bash (and zsh) is explained in this other SE article but it's ...
PRouleau's user avatar
  • 273
0 votes
0 answers
70 views

Pass in argument of directory for find command to ignore in script

When I call the script (via commandline) I'd like to pass in an optional list of directories for the find command to ignore. This is what I have but my output includes data from files in the ...
Kaverni's user avatar
2 votes
2 answers
342 views

commands execution based on file size fails with no apparent issues

I was working on an array job for a small pipeline, and I happened to need a way to execute a specific command based on file size. I found this post and similar which describe how to do it. At the ...
Matteo's user avatar
  • 199
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
0 votes
2 answers
89 views

How to find files with find tool in system path ($PATH)? Or alternatively, How to specify starting-point directory for find as an expression?

For example, I want to find all symlinks that reference to particular binary in all directories that belong to system $PATH. This can be successfully achieved with manual specification of all ...
Anton Samokat's user avatar
0 votes
1 answer
217 views

How to exclude multiple directories from chown -R?

I am writing a bash alias to fix permissions that keep getting messed up on my Synology NAS while running Docker. I just need to chown & chmod everything in the /volume1/docker directory except ...
DasKraut's user avatar
2 votes
2 answers
245 views

Search and replace composed Unicode characters

I have a deep folder structure on a Debian machine where the directory names and the filenames contain some "special" characters (ä,ö,ü).  However, these are not in "ISO-8859-1" ...
rockZ's user avatar
  • 789
0 votes
1 answer
60 views

find with execdir, pipe redirection evaluated too early (quote issue?)

I use multiple GitHub accounts at work, so I need to modify the remote url to add my work account. I have figured out the recursive find -execdir, and how to get/sed/set the remote url, but I cannot ...
Robert Altman's user avatar
1 vote
0 answers
24 views

find subdirectories from different mount points without symlinks that have the same name as the subdirectory [duplicate]

I struggle to find a working find command, I hope someone has an idea. Imagine the following structure, where path and path{0..1} exist and they are each mounted from a network storage device: dir: /...
Oliver R.'s user avatar
  • 141
1 vote
3 answers
525 views

Build find command from arguments

I often need to find a file, but I'm not sure what the name is, something like this: $ find -iname '*foo*' -o -iname '*bar*' -o -iname '*blah*' This is a little tedious. I'd like to create an alias ...
Big McLargeHuge's user avatar
0 votes
1 answer
120 views

Pipe sql query to find command

OS: RockyLinux 8.5 This command works wonderfully: sqlite3 files.db "select file from A;" | rsync -R -av --files-from=/dev/stdin /SOURCE /DESTINATION/Out result without pipe: sqlite3 files....
Gary Schermer's user avatar
1 vote
4 answers
225 views

How to sort and filter images by modification time and view them in nsxiv on FreeBSD

I am using nsxiv to view JPEG and PNG images on FreeBSD. However, I am unable to find a way to sort and filter the images by modification time to view them in nsxiv on FreeBSD. On Linux with GNU ...
Flux's user avatar
  • 3,198
3 votes
2 answers
1k views

I want to find lines where a specific word appears in a file along with line number and take the line numbers in an array .How to do that in bash?

This returns line numbers but they are in a string: grep -n -F -w $word $file | cut -d : -f 1
Arpan Koley's user avatar
1 vote
2 answers
265 views

Execute on all files without corresponding extension

How can I find and execute a program when the said file does not have a corresponding file? Example files: /file1.c /file1.h /file2.c /file3.c /file3.hpp /file4.c/unrelated.txt find / -type f -...
wjwrpoyob's user avatar
  • 460

15 30 50 per page
1
2 3 4 5
26