Brittany Snow
Member level 3
I am learning Linux on **broken link removed**, there is a question, how can I make find command to show size of files also? Do I need to use -exec ls -l or xargs etc?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Help is too large for me to read.for every command there will be a help option....
try
find --help
and read the usage
there you can see all options related to the find command
you have to use the -exec ls option.
but to apply to the found file only.
for example if you want to find *.txt
give
find . -name "*.txt" -exec ls -l {} \;
the . operator should be changed to your reqd directory.
find . -name "*.txt" -exec ls -l {} \;
the . operator should be changed to your reqd directory.
Sorry but I can't find the size of the files. Do you have other command about it? Thanks.
Try: "find --help | less" (or use Shift+PgUp/PgDn to page back & forth through text in a terminal). Other options:Help is too large for me to read.
Try: "find --help | less" (or use Shift+PgUp/PgDn to page back & forth through text in a terminal). Other options:
man find
info find
The size is displayed in bytes. Use -h switch in ls to show human readable format. Like ls -lh
find . -name "*.txt" -exec ls -lh {} \;
About -exec and xargs... look at it this way...
-exec will perform given command on every found object separately
xargs gets all results as one big chunk (like a txt file, only from RAM)