This command:
rm -rf "$HOME/.quicklock/locks/"*
does seem to remove files or folders in the locks directory, which start with "."
how can I remove those files too? Any other filenames that would fail to be removed given that command?
This command:
rm -rf "$HOME/.quicklock/locks/"*
does seem to remove files or folders in the locks directory, which start with "."
how can I remove those files too? Any other filenames that would fail to be removed given that command?
You can use a clever combination of wildcards to avoid . and ..:
rm -fr .??*
would be one of them, which works if you don't have any files or directories that are only 2 characters long (like .x for example).
rm -fr .[!.]*
does that job better.
I got a suggestion to do this:
rm -rf "$HOME/.quicklook/locks";
mkdir -p "$HOME/.quicklock/locks";
should work, I guess.
"$HOME/.quicklock/locks" to always exist, but nothing that mkdir -p can't solve if I just use that command elsewhere.
– Alexander Mills
Apr 20 '18 at 01:39
rm -rf "$HOME/.quicklock/lock" && mkdir $HOME/.quicklock/lock? – tachomi Apr 20 '18 at 00:09