Check These Out
Converts any number of seconds into days, hours, minutes and seconds.
sec2dhms() {
declare -i SS="$1"
D=$(( SS / 86400 ))
H=$(( SS % 86400 / 3600 ))
M=$(( SS % 3600 / 60 ))
S=$(( SS % 60 ))
[ "$D" -gt 0 ] && echo -n "${D}:"
[ "$H" -gt 0 ] && printf "%02g:" "$H"
printf "%02g:%02g\n" "$M" "$S"
}
or
$ tree -ifsF --noreport .|sort -n -k2|grep -v '/$'
(rows presenting directory names become hidden)
Newer versions of the flashplayer browser plugin delete the tmp flash video immediately after opening a filehandle to prevent the user from "exporting" the video by simply copying the /tmp/FlashXYZ file. This command searches such deleted flash videos and creates symbolic links to the opened filehandle with the same name as the deleted file.
This allows you to play your flash-videos (from e.g. youtube) with e.g. mplayer or copy the buffered video if you want to keep it.
In this case searches for where .desktop files are stored. The resulted is a sorted list of the top directories containing such files.
It's common to want to split up large files and the usual method is to use split(1).
If you have a 10GiB file, you'll need 10GiB of free space.
Then the OS has to read 10GiB and write 10GiB (usually on the same filesystem).
This takes AGES.
.
The command uses a set of loop block devices to create fake chunks, but without making any changes to the file.
This means the file splitting is nearly instantaneous.
The example creates a 1GiB file, then splits it into 16 x 64MiB chunks (/dev/loop0 .. loop15).
.
Note: This isn't a drop-in replacement for using split. The results are block devices.
tar and zip won't do what you expect when given block devices.
.
These commands will work:
$ hexdump /dev/loop4
.
$ gzip -9 < /dev/loop6 > part6.gz
.
$ cat /dev/loop10 > /media/usb/part10.bin
Uses the python-based AWS CLI (https://aws.amazon.com/cli/) and the JSON query tool, JQ (https://stedolan.github.io/jq/)
No need for sort