How do I check if a file is empty in Unix?

Đức Linh

New member
How do I check if a file is empty in Unix?
Answer
How do I check if a file is empty in Bash? You can use the find command and other options as follows.
The -s option to the test builtin check to see if FILE exists and has a size greater than zero. It returns true and false values to indicate that file is empty or has some data.
 

Tìm kiếm

Back
Top