This can be done with find (and xargs),
but it won’t win any beauty contests.
Write a script called check_files:
#!/bin/sh
find "$@" -size +800M –print
Then run
xargs -d '\n' < xyz/symlinks_paths.txt ./check_files
where
- You can move
< xyz/symlinks_paths.txt redirection
to the end of the command line,
as in xargs -d '\n' ./check_files < xyz/symlinks_paths.txt,
or to the beginning, or anywhere else.
Or you can replace it with -a xyz/symlinks_paths.txt.
Any of these mean that xargs will read from xyz/symlinks_paths.txt.
- You can replace
./check_files
with an absolute pathname to your check_files script.
-d '\n' means use newline as the delimiter
when reading xyz/symlinks_paths.txt.
You can probably leave this off
if your filenames don’t contain whitespace (space(s) or tab(s)),
quotes (remember that a single quote (')
is the same character as an apostrophe)
or backslashes,
and you’re willing to wager a year’s salary that they never ever will.
This reads each line of the file
and makes it an argument to the check_files script,
which passes them to find as starting-point arguments.
Many people know that you can run find
with multiple starting-point arguments; e.g.,
find dir1 dir2 dir3 search-expression
It’s not so well known that those arguments don’t have to be directories;
they can be files; e.g.,
find file1 file2 file3 search-expression
(or a mixture of directories and files).
find will simply apply the expression
to each file named as a starting-point.
So this checks each file whose name is listed in xyz/symlinks_paths.txt
to see whether its size is 800M or more, and prints those that are.
If the filenames might refer to symbolic links
(as the xyz/symlinks_paths.txt name suggests)
and you want to look at the pointed-to files (which you surely do),
change find to find -L.
You don’t need to have a separate check_files script; you can do
xargs -d '\n' < paths.txt sh -c 'find "$@" -size +800c -print' sh
Again, change find to find -L if desired.