Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to make find command show size of files also

Status
Not open for further replies.

Brittany Snow

Member level 3
Joined
Aug 30, 2011
Messages
58
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,306
Activity points
1,672
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?
 

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.
 

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
Help is too large for me to read.

---------- Post added at 14:39 ---------- Previous post was at 14:37 ----------

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.

Sorry but I can't find the size of the files. Do you have other command about it? Thanks.
 

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.


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)
 

Try: "find --help | less" (or use Shift+PgUp/PgDn to page back & forth through text in a terminal). Other options:

man find
info find

Yes , thank you very much.

---------- Post added at 15:13 ---------- Previous post was at 15:12 ----------

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)

This is the quick fix and it help very much. Thanks very much
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top