Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a temporary directory under a directory in bash [duplicate]

Tags:

bash

How to create a temporary directory under a directory. I tried mktemp -d -p but unable to figure out how to create temp directory under a give directory.

Please provide example with mktemp

like image 566
kanna Avatar asked Dec 14 '25 17:12

kanna


1 Answers

Try this with mktemp from coreutils:

mktemp -d -p /path/to/dir
like image 93
Cyrus Avatar answered Dec 16 '25 12:12

Cyrus