Created
October 21, 2013 09:13
-
-
Save tueda/7080899 to your computer and use it in GitHub Desktop.
filesize <filename> prints the size of the given file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filesize() { | |
if [ -f "$1" ]; then | |
wc -c "$1" | awk '{print $1}' | |
else | |
echo "filesize: file $1 doesn't exist" >&2 | |
return 1 | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment