til/bash-scripting/getting-the-size-of-a-file.md

7 lines
116 B
Markdown
Raw Normal View History

2021-07-03 16:14:42 +02:00
You can get the size of a file in bytes with:
```bash
2021-07-03 16:14:42 +02:00
stat -c %s file_name
# example
size=$(stat -c %s $myfile)
```