Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking to install the package for tempfile but am not finding it? possibly use mktemp but I'm not sure if there is a difference in behaviour besides a dot notation in the temp name?

$ tempfile # /tmp/file1wJzkz
$ mktemp   # /tmp/tmp.IY8k24NayM
share|improve this question
up vote 5 down vote accepted

The name generated by mktemp can be modified to have no dots. For example:

mktemp XXXXX => 8U5yc
mktemp /tmp/XXXXX => /tmp/tsjoG

From man mktemp:

   Create a temporary file or directory, safely, and print its name.  TEM‐
   PLATE must contain at least 3 consecutive 'X's in last  component.   If
   TEMPLATE is not specified, use tmp.XXXXXXXXXX, and --tmpdir is implied.
   Files are created u+rw, and directories  u+rwx,  minus  umask  restric‐

In any case, forget about tempfile, just use mktemp. The following is from man tempfile on my Debian (emphasis mine):


Exclusive creation is not guaranteed when creating files on NFS partitions. tempfile cannot make temporary directories. tempfile is deprecated; you should use mktemp(1) instead.

share|improve this answer
+1 and accepted, thanks for the prompt answer – ehime Nov 15 '13 at 17:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.