Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tempfile command?

Status
Not open for further replies.

cpjust

Programmer
Sep 23, 2003
2,132
US
I see there's a command called 'tempfile' which creates a unique file for you, but what I'm wondering is: does it automatically delete that temp file for you at some point?
If not, is there a way to do that? Maybe delete the file as soon as the current shell ends?
 
mktemp(1) - Linux man page

I think that those tempfiles get removed when you either close the bash session or upon a reboot...

but do not quote me on that...

Ben

"If it works don't fix it! If it doesn't use a sledgehammer..."
 
Well given the examples on that page, it looks like you need to delete it yourself. :-(
I tried logging out of bash after using the tempfile command and the file didn't get deleted automatically. I haven't tried rebooting, but that sounds like a possibility.
 
It just creates a uniquely named file owned by you. If you do not want lots of oddly named temporary files lying around, maybe containing sensitive information, you should specifically delete the file after use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top