Created
October 18, 2015 00:00
-
-
Save Birchwell/e1dcb5055cfea83b8f28 to your computer and use it in GitHub Desktop.
Shows the actual size of files in Thunar. Thunar has a strange problem of not reporting the correct size of files.
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
#! /bin/bash | |
kb=$((2**10)) | |
mb=$((2**20)) | |
for file in $@; do | |
if [ ! -e $file ]; then | |
continue | |
fi | |
b1=`ls -l $file | cut -d" " -f5` | |
let "b += b1" | |
done | |
k=`echo -e "scale=2; $b/$kb" | bc` | |
m=`echo -e "scale=2; $b/$mb" | bc` | |
zenity --info --title="Actual File Size" --width=300 --height=100 --text="$b bytes\n$k KB\n$m MB" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment