Author Topic: How can I get rid of ~/tmp folder?  (Read 1143 times)

Offline growbag

  • Full Member
  • ***
  • Posts: 90
How can I get rid of ~/tmp folder?
« on: December 10, 2010, 07:13:52 AM »
I know I can simply redirect it with a link, but I really hate seeing the blasted thing when I run Dolphin!

I want to reassign it to a sub-folder in the standard tmp location for the entire system, rather than have it sitting in my home folder.

Thanks :)
desktop - ASUS M4A79XTD Evo, PhenomII X2-550, 4gigs DDR3, nVidia GTX260.

laptop - Alienware m17x, i7, 6gigs DDR3, single MXM type IIIb ATI 4870.

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6372
  • I'm going South
Re: How can I get rid of ~/tmp folder?
« Reply #1 on: December 10, 2010, 07:23:32 AM »
Many programs expect to find a tmp folder in your home directory, so I wouldn't try to get rid of it entirely.

But by default ~/tmp used to be just a link to /tmp. If yours isn't, just delete it and replace it with a link.

(Note that /tmp should have the sticky bit set to keep other people from deleting your users' temporary files.)
« Last Edit: December 10, 2010, 07:32:37 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

uncleV

  • Guest
Re: How can I get rid of ~/tmp folder?
« Reply #2 on: December 10, 2010, 07:31:57 AM »
May be you haven't enough space in your /home partition and you want all of the temporarily files in your home written in your / partition?

I am not sure if this is good but you can create a link named tmp which will substitute the real tmp directory in your /home partition/directory.
For that purpose go to root account, create a subdirectory in your /tmp/<new directory>, go to your /home, copy all files from /home/tmp to /tmp/<new directory>, right-click on the /home/tmp directory, choose "Create link" pointing to /tmp/<new directory> and name it to say "_tmp", delete your /home/tmp directory and after that rename the link created by you from "_tmp" to "tmp".

But wait please for others to say if it is good at all. See my signature ;)

P.S. Oh yeah! Bald Bird already is telling us the truth :)
P.S.S. Bald Bird means Black Brick. No! Brake Brick means... I am lost... :'(
« Last Edit: December 10, 2010, 07:40:29 AM by uncleV »

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6372
  • I'm going South
Re: How can I get rid of ~/tmp folder?
« Reply #3 on: December 10, 2010, 07:53:52 AM »
you can create a link named tmp which will substitute the real tmp directory in your /home partition/directory.

This part is true, uncleV.

Quote
For that purpose go to root account, create a subdirectory in your /tmp/<new directory>, go to your /home, copy all files from /home/tmp to /tmp/<new directory>, right-click on the /home/tmp directory, choose "Create link" pointing to /tmp/<new directory and name it to say "_tmp", delete your /home/tmp directory and after that rename the link created by you from "_tmp" to "tmp".

I don't think linking ~/tmp to a subdirectory of /tmp is a good idea. You'd have to recreate that subdirectory every time you clear /tmp (and if /tmp is in RAM it is cleared every time you shut down). Creating ~/tmp as a link to /tmp itself will usually work well however, and if /tmp has the sticky bit set (as it has by default) a user's temporary files remain relatively safe from tampering.
« Last Edit: December 10, 2010, 08:02:20 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

uncleV

  • Guest
Re: How can I get rid of ~/tmp folder?
« Reply #4 on: December 10, 2010, 07:57:42 AM »
My real question to growbag is why does he think he is forced to try this?

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6372
  • I'm going South
Re: How can I get rid of ~/tmp folder?
« Reply #5 on: December 10, 2010, 08:01:24 AM »
P.S. Oh yeah! Bald Bird already is telling us the truth :)
P.S.S. Bald Bird means Black Brick. No! Brake Brick means... I am lost... :'(

 ;D ;D ;D
A rose by any other name ...
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: How can I get rid of ~/tmp folder?
« Reply #6 on: December 10, 2010, 08:34:52 AM »
Quote
I know I can simply redirect it with a link, but I really hate seeing the blasted thing when I run Dolphin!

Not to sound harsh ....  but tough!

The running applications require it to be there.

You could try using memory for /tmp .......  but that has its problems too; especially if/when you run out of tmp space in memory ....  and I am even unsure if it eliminates the link under ~/  or not.

So my answer is ......  get used to it ......

I have no idea if it might be possible to prevent that from being displayed in Dolphin ...  that might be worth looking into .... and would have no negative effects on the running system.

regards.

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6372
  • I'm going South
Re: How can I get rid of ~/tmp folder?
« Reply #7 on: December 10, 2010, 08:46:00 AM »
Quote
I know I can simply redirect it with a link, but I really hate seeing the blasted thing when I run Dolphin!

Not to sound harsh ....  but tough!

The running applications require it to be there.

You could try using memory for /tmp .......  but that has its problems too; especially if/when you run out of tmp space in memory ....  and I am even unsure if it eliminates the link under ~/  or not.

It doesn't. You still need a ~/tmp whether that is a normal directory or a link to /tmp or a link to some other folder.

Quote
So my answer is ......  get used to it ......

I have no idea if it might be possible to prevent that from being displayed in Dolphin ...  that might be worth looking into .... and would have no negative effects on the running system.

regards.
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Was_Just19

  • Hero Member
  • *****
  • Posts: 6852
  • MLU
Re: How can I get rid of ~/tmp folder?
« Reply #8 on: December 10, 2010, 08:56:56 AM »
Quote
I know I can simply redirect it with a link, but I really hate seeing the blasted thing when I run Dolphin!

Not to sound harsh ....  but tough!

The running applications require it to be there.

You could try using memory for /tmp .......  but that has its problems too; especially if/when you run out of tmp space in memory ....  and I am even unsure if it eliminates the link under ~/  or not.

It doesn't. You still need a ~/tmp whether that is a normal directory or a link to /tmp or a link to some other folder.

Yeah .....  if I had bothereed to think about it that would have been obvious ...  ;D

Thanks for correcting that.  ;)

Offline growbag

  • Full Member
  • ***
  • Posts: 90
Re: How can I get rid of ~/tmp folder?
« Reply #9 on: December 11, 2010, 01:36:27 AM »
Yes, I already have /tmp in RAM, so that part is working well.

But I must be able to modify it somewhere, this is Linux after all!  I'm sure there'll be a config file somewhere.
desktop - ASUS M4A79XTD Evo, PhenomII X2-550, 4gigs DDR3, nVidia GTX260.

laptop - Alienware m17x, i7, 6gigs DDR3, single MXM type IIIb ATI 4870.

Offline aguila

  • Hero Member
  • *****
  • Posts: 1210
  • soaring high = no Windows here :-D
Re: How can I get rid of ~/tmp folder?
« Reply #10 on: December 11, 2010, 04:16:02 AM »
You said you

really hate seeing the blasted thing when I run Dolphin!

If it's for the size of it, there's an option to empty it at boot in PCC / Boot. Don't know though if that would be the solution of your preference. :)

Aguila
All that is is good. PCLinuxOS is.

Thinkpad X61 Tablet, Core2Duo 1.66 MHz, 4 GB Ram, Intel onboard Graphics, Plextor PX-256M3 256 GB SSD; Thinkpad R61i, Core2Duo 1.66 MHz, 2 GB Ram, Intel onboard graphics, 120 GB HDD

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6372
  • I'm going South
Re: How can I get rid of ~/tmp folder?
« Reply #11 on: December 11, 2010, 07:32:28 AM »
You said you

really hate seeing the blasted thing when I run Dolphin!

If it's for the size of it, there's an option to empty it at boot in PCC / Boot.

Ticking it in PCC doesn't actually clean /tmp at a reboot: it adds the line
Code: [Select]
none /tmp tmpfs defaults 0 0to /etc/fstab, which moves /tmp to a virtual memory filesystem in RAM -- and that, of clourse, will give you an empty /tmp at your next reboot. But growbag already has /tmp in RAM.
« Last Edit: December 11, 2010, 07:39:41 AM by Bald Brick »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D

Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6372
  • I'm going South
Re: How can I get rid of ~/tmp folder?
« Reply #12 on: December 11, 2010, 07:38:44 AM »
Yes, I already have /tmp in RAM, so that part is working well.

But I must be able to modify it somewhere, this is Linux after all!  I'm sure there'll be a config file somewhere.


If you have /tmp in RAM on a tmpfs filesystem you can modify the defaults by editing its line in /etc/fstab. For info on how to do it: http://www.ibm.com/developerworks/library/l-fs3.html

But if you don't want any applications to look for a local tmp in your home directory, you probably have to hack all the applications that do.
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D