Check These Out
Using this command you can track a moment when usb device was attached.
Go to tmp :
cd /tmp; mkdir retmp; cd retmp
Create 10 files :
for i in {1..10}; do touch test$i; done
Remove all files except test10 :
rm !(test10)
Shorter version.
Rather than complicated and fragile paths relative to a script like "../../other", this command will retrieve the full path of the file's repository head. Safe with spaces in directory names. Works within a symlinked directory. Broken down:
$cd "$(dirname "${BASH_SOURCE[0]}")"
temporarily changes directories within this expansion. Double quoted "$(dirname" and ")" with unquoted ${BASH_SOURCE[0]} allows spaces in the path.
$git rev-parse --show-toplevel
gets the full path of the repository head of the current working directory, which was temporarily changed by the "cd".
It's certainly not nicely formatted SQL, but you can see the SQL in there...
spectrum protect's dsmc command shows file names and total amount of restore.
This command shows which files are actually open and their siz in GB and highlights the change to the previous output
Please take notice that if you are going to use an JPG file for shadow effect,
let change -background none to -background white!
Because -background none make a transparent effect while JPG doesn't support transparent! And when viewing, you will get a bacl box!
So we will use an white background under! We can use other color as well!
Every rm'ed a file you needed? Of course you haven't. But I have. I got sick of it so I created a bash function. Here it is. It'll put trashed files into a $HOME/.Trash/"date" folder according to the date. I have rm aliased to it as well in my bashrc so that I still use the rm command. It'll choke if you attempt to trash a directory if that directory name is already in the Trash. This rarely happens in my case but it's easy enough to add another test and to mv the old dir if necessary.
function trash(){
if [ -z "$*" ] ; then
echo "Usage: trash filename"
else
DATE=$( date +%F )
[ -d "${HOME}/.Trash/${DATE}" ] || mkdir -p ${HOME}/.Trash/${DATE}
for FILE in $@ ; do
mv "${FILE}" "${HOME}/.Trash/${DATE}"
echo "${FILE} trashed!"
done
fi
}