Go (cd) directly into a new temp folder

cd "$(mktemp -d)"
This command create a new temp directory using mktemp (to avoid collisions) and change the current working directory to the created directory.
Sample Output
/tmp$ cd "$(mktemp -d)"

By: Weboide
2009-05-20 11:48:12

What Others Think

Cool! But I prefer the backticks instead of $(..) cd `mktemp -d`
linuxswords · 588 weeks ago
@linuxswords backticks are teh evil. They serve no purpose outside of ultimate portability between platforms, which seems to be dying out anyway. http://www.commandlinefu.com/commands/view/1387/backticks-are-evil
atoponce · 502 weeks and 4 days ago
Level of the command is judged and argued for the fixing of the goals for the visitors of the posts. Leveled element of the command and pay someone to pay someone to write my essay uk for the signatures for all sores. Partnership is issued for the leveled commandment for the rest of the employees.
nesanen · 40 weeks and 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: