graudeejs Jan 12, 2009 #1 How to check single file size with sh? I'm writing script for burning cds/dvds I want to check if iso image fits cd/dvd is there any command for doing something like this? [i know i can use awk..., (which i also don't know how to use without hours of experiments. lol)]
How to check single file size with sh? I'm writing script for burning cds/dvds I want to check if iso image fits cd/dvd is there any command for doing something like this? [i know i can use awk..., (which i also don't know how to use without hours of experiments. lol)]
OP graudeejs Jan 12, 2009 Thread Starter #3 dam, why didn't thought about it. I use this program so many times. lol
bsddaemon Jan 13, 2009 #4 ls without alias would produce the same output: % \ls -la 7.0-RELEASE-i386-livefs.iso | awk '{print $5}' 224655360 Click to expand...
ls without alias would produce the same output: % \ls -la 7.0-RELEASE-i386-livefs.iso | awk '{print $5}' 224655360 Click to expand...
DutchDaemon Administrator Staff member Administrator Moderator Developer Jan 13, 2009 #5 'ls -s file' will almost get you there
OP graudeejs Jan 13, 2009 Thread Starter #6 ye, i know that, i just didn't though it'll be so easy with awk
D dinoex@ Developer Jan 13, 2009 #7 shell using "stat" eval $(stat -s "${name}") echo "size: ${st_size}"
ephemera Jan 13, 2009 #8 dinoex@ said: eval $(stat -s "${name}") echo "size: ${st_size}" Click to expand... Nice.
D Darwin Jan 18, 2009 #9 try "Human-readable": ls -lah somefile | awk '{print $5}' Code: (21:51)-[Darwin@home ~]% ls -lah somefile | awk '{print $5}' 3,2M
try "Human-readable": ls -lah somefile | awk '{print $5}' Code: (21:51)-[Darwin@home ~]% ls -lah somefile | awk '{print $5}' 3,2M