Multi-distro LiveUSB/size.sh
From ParabolaWiki
#!/bin/sh # If the work is copyrightable: # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. iso="$1" # Find the file size in bytes link="$(readlink ${iso})" && iso="${link}" size="$(ls -g -G ${iso} | awk '{print $3}')" # Calculate the size in K, add padding if necessary size_k="$(expr ${size} / 1024)" size_k_rem="$(expr ${size} % 1024)" if [ "${size_k_rem}" != "0" ] ; then size_k="$(expr ${size_k} + 1)" fi echo "+${size_k}K"