Shell file size in Linux

linux, shell

Solution

filesize=$(stat -c '%s' testing.txt)

Problem

How can I get the size of a file into a variable? ``` ls -l | grep testing.txt | cut -f6 -d' ' ``` gave the size, but how can I store it in a shell variable?

Original source

Related problems