Check These Out
List all open files of all processes.
.
$ find /proc/*/fd
Look through the /proc file descriptors
.
$ -xtype f
list only symlinks to file
.
$ -printf "%l\n"
print the symlink target
.
$ grep -P '^/(?!dev|proc|sys)'
ignore files from /dev /proc or /sys
.
$ sort | uniq -c | sort -n
count the results
.
Many processes will create and immediately delete temporary files.
These can the filtered out by adding:
$ ... | grep -v " (deleted)$" | ...
Batch rename extension of all files in a folder, in the example from .txt to .md
mmv most likely must be installed, but is very powerfull when you want to move/copy/append/link multiple files by wildcard patterns.
Shows all block devices in a tree with descruptions of what they are.
for example if you did a:
$ ls -la /bin/ls
then
$ ls !$
is equivalent to doing a
$ ls /bin/ls
A null operation with the name 'comment', allowing comments to be written to HISTFILE. Prepending '#' to a command will *not* write the command to the history file, although it will be available for the current session, thus '#' is not useful for keeping track of comments past the current session.
Based on capsule8 agent examples, not rigorously tested
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"
}
I find it useful, when cleaning up deleting unwanted files to make more space, to list in size order so I can delete the largest first.
Note that using "q" shows files with non-printing characters in name.
In this sample output (above), I found two copies of the same iso file both of which are immediate "delete candidates" for me.
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"
}
This will be seen through your system's visual notification system, notify-osd, notification-daemon, etc.
---
sleep accepts s,m,h,d and floats (date; sleep .25m; date)
---
notify-send (-t is in milliseconds && -u low / normal / critical)
man notify-send for more information
---
notification-daemon can use b/i/u/a HTML