From f07121706cbb0d8d2aabd7511af47e77a983b3e9 Mon Sep 17 00:00:00 2001 From: Asocia Date: Sat, 3 Jul 2021 17:14:42 +0300 Subject: [PATCH] TIL: Getting the size of a file --- bash-scripting/getting-the-size-of-a-file.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 bash-scripting/getting-the-size-of-a-file.md diff --git a/bash-scripting/getting-the-size-of-a-file.md b/bash-scripting/getting-the-size-of-a-file.md new file mode 100644 index 0000000..ae690cf --- /dev/null +++ b/bash-scripting/getting-the-size-of-a-file.md @@ -0,0 +1,6 @@ +You can get the size of a file in bytes with: +``` +stat -c %s file_name +# example +size=$(stat -c %s $myfile) +```