How can I see in SSH the list of files in /tmp?

rafael.martinez

Active Member
Jan 15, 2021
41
7
8
El Salvador
cPanel Access Level
Root Administrator
One of my clients was able to enable me to activate the PHP.exif extension and I have noticed that since then in server state the /tmp folder fills up every day.

I would like to know why that folder fills up every day, maybe with an SSH command I can see the list of files.

Greetings.
 

Spirogg

Well-Known Member
Feb 21, 2018
700
163
43
chicago
cPanel Access Level
Root Administrator
One of my clients was able to enable me to activate the PHP.exif extension and I have noticed that since then in server state the /tmp folder fills up every day.

I would like to know why that folder fills up every day, maybe with an SSH command I can see the list of files.

Greetings.
you can try find /tmp
or find /var/tmp
or what ever path your /tmp folder is in.

or you can cd /tmp
cd /var/tmp
or cd /path/to/your/tmp

then once you are at [root@yourserver tmp]#
you type in ls or dir
this will give you a list of all files in that directory
 
  • Like
Reactions: cPRex

cagsmith

Member
Jul 21, 2021
13
8
3
Sweden
cPanel Access Level
Root Administrator
It sounds like you have the session.save_path configured to /tmp in php.ini

It should be set probably to one of the following:

Alt PHP (CloudLinux): /opt/alt/php74/var/lib/php/session
EA PHP (cPanel default): /var/cpanel/php/sessions/ea-php74

The second one I think is correct, although could be wrong - you'll need to check. The version will need to be changed if you're not using PHP 7.4.

Those should then get purged of session files automatically, although you can always create a cron to purge those - if I recall correctly they all follow the name template of:

sess_XYZ, where "XYZ" is a long string of numbers and possibly letters a-f