SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Because * does not expand hidden files by default (but can be changed).
BTW, tmpfs is much slower than ext3/4, etc. when it makes extensive use of swap.
Distribution: Slackware64 15.0 (started with 13.37). Testing -current in a spare partition.
Posts: 926
Rep:
Quote:
Originally Posted by guanx
Because * does not expand hidden files by default (but can be changed).
BTW, tmpfs is much slower than ext3/4, etc. when it makes extensive use of swap.
That's right, I use "ls -A" to list hidden files and a loop to clean /tmp
Quote:
Originally Posted by cisneros
so if the script fails the deleting process does not stop, because every file triggers a different rm process, i guess...
I didn't know that. But I didn't note any delay at shutdown by cleaning /tmp
BTW, tmpfs is much slower than ext3/4, etc. when it makes extensive use of swap.
Yes, that makes sense... But surely, modern desktop machines with 6 to 8 gigs of memory wouldn't really need to use swap that much, would they?
In the ~15 years I've been using Linux as my main desktop OS, I almost cannot recall ever seeing it actually use swap... maybe back when my machine had 256Mb RAM and I was running StarOffice on KDE, but certainly not much at all in recent years.
Yes, that makes sense... But surely, modern desktop machines with 6 to 8 gigs of memory wouldn't really need to use swap that much, would they?
In the ~15 years I've been using Linux as my main desktop OS, I almost cannot recall ever seeing it actually use swap... maybe back when my machine had 256Mb RAM and I was running StarOffice on KDE, but certainly not much at all in recent years.
totally correct. it doesn't make sense to set up a swap device at all on most machines these days. Unfortunately the internet is still full of braindonated guides advising you to set up swap, sometimes even at twice the size of RAM. But technically guanx is right: it is madness to trade tmpfs for swap. Anything that might trigger the use of swap and thus thrashing should be avoided.
That's right, I use "ls -A" to list hidden files and a loop to clean /tmp
As a general best practice, avoid parsing the output of ls if you can. Files containing weird characters can be a problem. The find solution provided in the OP post is a bit more verbose, but totally secure in that regard, using null characters as terminators (a null character can never appear in the middle of a name in Linux).
I think find/xargs does not introduce more security than the dotglob shopt but find/xargs is more portable and also works when there are too many files.
Yes, that makes sense... But surely, modern desktop machines with 6 to 8 gigs of memory wouldn't really need to use swap that much, would they?
In the ~15 years I've been using Linux as my main desktop OS, I almost cannot recall ever seeing it actually use swap... maybe back when my machine had 256Mb RAM and I was running StarOffice on KDE, but certainly not much at all in recent years.
Thanks for sharing your experience. So you rarely used swap since 1998? I believe you because Bill Gates used to say 640kB was enough, and in 1998 you could get 64MB for a PC, nearly 100 times more than enough.
However, 8 GB is not large enough for my temp files. I also use suspend to disk more than once per day. I think I'm far from getting rid of swap.
Many years ago the ratio between memory speed and disk speed (latency + transfer rate) was low, and memory was VERY expensive - thus virtual memory (page swapped to disk) was plausible. However, since then, memory has become both fantastically cheap and fast, while disk speed has not even come close to matching those advances. 30 years back I was dealing with mainframe disks of 200 MegaBytes in size (quite large then) which had latencies of about 15 millisecs. Now disks are down to maybe 5 millisecs. Transfer rates are better, but maybe 30 to 100 times. Memory is millions of times larger and almost billions of times cheaper. So,, if your system starts swapping in any fashion, it will appear that your machine is driving through treacle. While it's true that SSD's are rewriting those rules, the issues they still have with write-cycles is a problem. Conclusion - don't use memory for temp files : they will increase the likelihood that you will use swap and die.
However, 8 GB is not large enough for my temp files.
!
what are you possibly doing with your machine to make this true?
to everyone who is saying that tmpfs will cause your machine to swap: you can easily limit the size of a tmpfs. mine is limited to 1 gig, and I've never come anywhere near filling it. this is on a machine with 4gigs ram, and I haven't yet seen any swapping... or at least I haven't noticed it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.