Computing.Net > Forums > Linux > How to know when a file is empty...

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How to know when a file is empty...

Reply to Message Icon

Name: JayF
Date: September 22, 2005 at 18:53:04 Pacific
OS: XP Pro/Gentoo
CPU/Ram: 2500+/256Mb
Comment:

Hi all,

I've been reading quite a bit and have still only found one way of knowing when a file is empty. It's a question one of my teacher asked : find two ways to know a file is empty.

So far I've come up with one,

ls --size if it's 0 in block then it's empty right?

I can't think of another though, beside opening it to check which would be cheesy and doesn't seems like the kind of answer he would like ;)

Thoughts?



Sponsored Link
Ads by Google

Response Number 1
Name: JayF
Date: September 22, 2005 at 19:22:12 Pacific
Reply:

mmmh well further experiment brought files sizes up with the command ls followed with various attributes so I guess I got two different ways of knowing if a file size is 0. I feel like I'm missing something here somehow, that question seem too easy.


0

Response Number 2
Name: Dlonra
Date: September 23, 2005 at 06:34:00 Pacific
Reply:

man test


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: How to know when a file is empty...

go through a file line by line? www.computing.net/answers/linux/go-through-a-file-line-by-line/24907.html

how to open a pdf files www.computing.net/answers/linux/how-to-open-a-pdf-files/25112.html

How to set up a site on my RH? www.computing.net/answers/linux/how-to-set-up-a-site-on-my-rh/23939.html