开发者

Changing temporary file folder location in linux (for everything on the system)?

开发者 https://www.devze.com 2023-01-17 14:00 出处:网络
Currently its /t开发者_如何学Pythonmp How can I set it to /anythingelse so that all applications use that subsequently?sudo rmdir /tmp && ln -s /some/other/loc /tmp

Currently its /t开发者_如何学Pythonmp

How can I set it to /anythingelse so that all applications use that subsequently?


sudo rmdir /tmp && ln -s /some/other/loc /tmp

Alternatively, set the environment variable TMPDIR at the highest level possible. For the environment, or per user.


Specific applications may have configuration options or environment variables for this, but in general *nix systems are supposed to use /tmp for temporary files, and this cannot be changed.


You can, if you really insist, make /tmp be a symbolic link to whatever location you want (Matt Joiner's answer gives the specific command to do that).

For example, on Mac OS, /tmp is a symlink to /private/tmp. This arrangement can be used to facilitate the ability to NFS-mount / (presumably read-only) while keeping system-specific files that can't be shared (/etc, /tmp, and so forth) in a /private partition on a local disk.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号