- filesize
- os.path.getsize
Bash
stat -c%s /etc/hosts
ls -l /etc/hosts | awk '{print $5}'
du -b /etc/hosts | awk '{print $1}'
PHP
echo filesize('/etc/hosts');
Python
import os
print( os.path.getsize('/etc/hosts') )
Perl
print -s '/etc/hosts';
stat -c%s /etc/hosts
ls -l /etc/hosts | awk '{print $5}'
du -b /etc/hosts | awk '{print $1}'
echo filesize('/etc/hosts');
import os
print( os.path.getsize('/etc/hosts') )
print -s '/etc/hosts';