How can I get just the file size in UNIX?

Phương Linh

New member
How can I get just the file size in UNIX?
Answer
Getting file size using find command
find “/etc/passwd” -printf “%s” find “/etc/passwd” -printf “%sn” fileName=”/etc/hosts” mysize=$(find “$fileName” -printf “%s”) printf “File %s size = %dn” $fileName $mysize echo “${fileName} size is ${mysize} bytes.”
 

Tìm kiếm

Back
Top