Avatar of chalie001
 asked on

temp file linux

hi how can i configure the temp folder
i what my  /usr1, /usr2, /usr3 path to poin to /temp with 10gib

Filesystem                 Size  Used Avail Use% Mounted on
devtmpfs                   3.8G     0  3.8G   0% /dev
tmpfs                      3.8G     0  3.8G   0% /dev/shm
tmpfs                      3.8G  8.9M  3.8G   1% /run
tmpfs                      3.8G     0  3.8G   0% /sys/fs/cgroup
/dev/mapper/app_zone-root   10G  4.6G  5.5G  46% /
/dev/mapper/app_zone-temp   10G   33M   10G   1% /temp
/dev/mapper/app_zone-usr2   30G   33M   30G   1% /usr2
/dev/mapper/app_zone-usr3   30G   33M   30G   1% /usr3
/dev/mapper/app_zone-usr1  120G   33M  120G   1% /usr1
/dev/mapper/app_zone-var    10G  2.7G  7.4G  27% /var
/dev/mapper/app_zone-home   10G   47M   10G   1% /home
/dev/sda2                   10G  219M  9.8G   3% /boot
tmpfs                      773M   16K  773M   1% /run/user/1000
/dev/sr0                    82M   82M     0 100% /run/media/calapp/VBox_GAs_6.0.
Linux* Virtual BoxVirtualizationLinux NetworkingLinux Distributions

Avatar of undefined
Last Comment
David Favor

8/22/2022 - Mon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
David Favor

Slightly expanding noci's solution.

Just be sure to set $TEMP + $TMPDIR globally somewhere, like /etc/environment or however your Distro manages global environment variables.

Remember, likely a reboot will be required for /etc/environment to be read by every running process.

based on comment from noci
export TEMP=/temp
export TMPDIR=/temp

Open in new window

write above statements in
or ~/.bash_profile file for making them permanent for required users.
>> Comment from David Facor
use /etc/environment file if required to set for all users. => require root or sudo access
David Favor

Whether you use ~/.* files or environment files + how exactly you approach all this depends on...

1) Do you require these variables being set only for interactive shells.

2) Do you require these variables being set for all shells (including background/batch/CRON) initiated shells.

Really best to start by answering these 2x questions, choosing a solution matching your answer.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.