Hacker News new | past | comments | ask | show | jobs | submit login

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!



Thank you! That's very neat, I'll implement this myself as well.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: