3

Is there a simple command in the terminal (or a command with a usage that I know not) that would output filesize in bytes of a file given a filename parameter?

9

You can use the stat command

stat -c '%s' filename

See man stat for details and other options

Or, with du

du -b filename
  • I like the stat better: it just gives file size as requested. I will accept it as soon as I am allowed to – anonymous2 Jun 2 '16 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.