Re:Using your Kindle as an e-ink monitor
by stavros on Sunday August 04, 2024 @04:15PM
(#41156034)
Oh man, apparently I'm not alone in using /tmp/ as my storage space. I like it because it's self-cleaning!
[ Parent
| on HN ]
You could have /home/junk2020, /home/junk2021, /home/junk2022 etc. Still self-cleaning, but it's once a year.
Or I could have /home/junk, self-cleaning but never!
That is me, I have `/home/delme` since forever!
You know what else is self-cleaning?
/dev/shm
The advantage being that it does not even touch the disk.One can use tmpfs for /tmp as well (and I do it).
I present you my most used shell function:
cdtmp() {
cd $(mktemp -d)
}That's fantastic, thanks! I always used to do this by hand. Though one downside is that the name is random, and it's hard to go back if you CD out. I might use diceware to make a memorable random name.
I agree that sometimes that is a problem, so I find out the latest tmp directory with ls -tr /tmp | tail. But using nicer names would help with that.
So I took your tip and now I have
cdtmp() {
local name
name=/tmp/$(diceware --no-caps -d - -n 2)
mkdir $name && cd $name
}
I decided not to worry about the directory existing already, or of the other checks mktemp -d would do for me in my single-user system.. I suppose mktemp -d -t cdtmpXXX would work almost as well. Thanks for the idea!