interesting! is that just for experimenting with files you might not keep? I'm always curious how others use filesystems, I make a lot of temp files but don't ever make a temp directory to put them in!
I don't either, but it's a cool idea because you can create a bunch of files for something and delete them all when you're done just by deleting the directory they're in. Also makes it so you don't have to worry about file name collisions between tasks.
One alias that I use many many times every day:
‘’’
alias cdtemp='cd $(mktemp -d)'
‘’’
It creates a new temporary directory and switch to that directory.
interesting! is that just for experimenting with files you might not keep? I'm always curious how others use filesystems, I make a lot of temp files but don't ever make a temp directory to put them in!
I don't either, but it's a cool idea because you can create a bunch of files for something and delete them all when you're done just by deleting the directory they're in. Also makes it so you don't have to worry about file name collisions between tasks.
Yes thats exactly how I use this alias. Another benefit is that in most of linux distros the ‘/tmp’ directory is cleared upon each reboot.
Whaaaaat I did not know this.