How can i clear all cache and buffered files in linux server (RHEL 5) ?
120792
I have a webserver that has 8GB of ram and is running a pretty intensive php site (1 site) that does file manipulation, graphing, emailing, forums, you name it.  The environment is far from static which leads me to believe that very little could be gained from caching anything in ram since almost every request to the server creates new or updated pages.  And a lot of caching is done client side so we have a ton of 304 requests when it comes to images, javascript, css.  Additionally I do have language files that are written to flat files on the server where cached ram definitely is good rather than reading from disk.  But there are only a handful of files like this.  In about a two weeks I've gone from having 98% free ram to 4% free ram.  This has occurred during a time in which we also push several large svn updates onto the server.  My question is whether my server will be better tuned if I periodically clear my cache (I'm aware of Linus Torvalds' feeling about cache) using the following command:  sync; echo 3 &gt; /proc/sys/vm/drop_caches   Or would I be better off editing the following file:  /proc/sys/vm/swappiness     If I replace the default value of 60 with 30 I should have much less swapping going on and a lot more reuse of stale cache.  It sure feels good to see all that cache freed up using the first command but I'd be lying to you if I told you this was good for the desktop environment.  But what about a web server like I've described above?  Thoughts?  EDIT: I'm aware that the system will acquire memory as it needs it from the cache memory but thanks for pointing that our for clarity.  Am I imagining things when Apache slows down when most of the server memory is stored in cache?  Is that a different issue altogether?
111234
I am trying to remove all files and subdirectories in a directory. I used rm -r to remove all files, but I want to remove all files and subdirectories, excluding the top directory itself.  For example, I have a top directory like images. It contains the files header.png, footer.png and a subdirectory.  Now I want to delete header.png, footer.png and the subdirectory, but not images.  How can I do this in linux?
22333
When administering Linux systems I often find myself struggling to track down the culprit after a partition goes full. I normally use du / | sort -nr but on a large filesystem this takes a long time before any results are returned.  Also, this is usually successful in highlighting the worst offender but I've often found myself resorting to du without the sort in more subtle cases and then had to trawl through the output.  I'd prefer a command line solution which relies on standard Linux commands since I have to administer quite a few systems and installing new software is a hassle (especially when out of disk space!)
15633
First, I know how to do it in Ubuntu. I could use Activity Log Manager to clear recent history.  However, it does not work on Xubuntu 12.04. The "recently used" history is always there after I tried using Activity Log Manager to clear all history.  In addition, BleachBit and Activity Journal both do not work.
5619
Prior to doing some benchmarking work how would one free up the memory (RAM) that the Linux Kernel is consuming for its buffers and cache?    Note that this is mostly useful for benchmarking. Emptying the buffers and cache reduces performance! If you're here because you thought that freeing buffers and cache was a positive thing, go and read . The short story: free memory is unused memory is wasted memory.
13643
I need to delete all compiled data:   directories called build, directories called obj, *.so files.   I wrote a command   find \( -name build -o -name obj -o -name *.so \) -exec rm -rf {} \;   that goes through all the directories recursively and deletes all I need.  Why do I have such an output at the end? Maybe I should write a different command.  find: `./3/obj': No such file or directory find: `./3/build': No such file or directory find: `./1/obj': No such file or directory find: `./1/build': No such file or directory find: `./2/obj': No such file or directory find: `./2/build': No such file or directory
80413
I tried to rm -rf a folder, and got "device or resource busy".  In Windows, I would have used LockHunter to resolve this. What's the linux equivalent? (Please give as answer a simple "unlock this" method, and not complete articles like . Although they're useful, I'm currently interested in just ASimpleMethodThatWorks™)
9634
How frequently is the proc file system updated on Linux? Is it 20 milliseconds (time quantum)?
103581
Please suggest me any particular unnecessary file that I can clean to back everything to normal condition(temporarily). (i.e. any log or archieve or anything ). My var/log has only 40MB and Home directory has 3GB of space(so I believe that's not a problem). Other than that what I can clean up to make space.   [user@host]$ df -h Filesystem            Size  Used Avail Use% Mounted on /dev/mapper/vg_inamivm-lv_root                        18G   17G     0 100% / tmpfs                 1.9G     0  1.9G   0% /dev/shm /dev/sda1             485M   71M  389M  16% /boot   I am in a debian machine.   UPDATE1:  output of  cd /; du -sxh *  6.1M    bin 61M     boot 156K    dev 22M        etc 3.3G    home 306M    lib 18M     lib64 16K     lost+found 4.0K    media 4.0K    mnt 408K    opt du: cannot access `proc/18605/task/18605/fd/4': No such file or directory du: cannot access `proc/18605/task/18605/fdinfo/4': No such file or directory du: cannot access `proc/18605/fd/4': No such file or directory du: cannot access `proc/18605/fdinfo/4': No such file or directory 0       proc 208K    root 9.7M    sbin 0       selinux 4.0K    srv 0       sys 8.0K    tmp 536M    usr 187M    var   Update2  Output of ls -la /  dr-xr-xr-x.  22 root root  4096 Aug  7 08:42 . dr-xr-xr-x.  22 root root  4096 Aug  7 08:42 .. -rw-r--r--.   1 root root     0 Aug  7 08:42 .autofsck dr-xr-xr-x.   2 root root  4096 Mar 28 16:53 bin dr-xr-xr-x.   5 root root  1024 Mar 28 16:54 boot drwxr-xr-x.  16 root root  3580 Sep  9 03:13 dev drwxr-xr-x.  69 root root  4096 Aug 23 09:19 etc drwxr-xr-x.   9 root root  4096 Jun 29 16:10 home dr-xr-xr-x.   8 root root  4096 Mar  7  2012 lib dr-xr-xr-x.   9 root root 12288 Mar 28 16:53 lib64 drwx------.   2 root root 16384 Mar  7  2012 lost+found drwxr-xr-x.   2 root root  4096 Sep 23  2011 media drwxr-xr-x.   2 root root  4096 Sep 23  2011 mnt drwxr-xr-x.   3 root root  4096 Mar  7  2012 opt dr-xr-xr-x. 355 root root     0 Aug  7 08:42 proc dr-xr-x---.   5 root root  4096 Aug 17 18:27 root dr-xr-xr-x.   2 root root  4096 May  2 09:13 sbin drwxr-xr-x.   7 root root     0 Aug  7 08:42 selinux drwxr-xr-x.   2 root root  4096 Sep 23  2011 srv drwxr-xr-x.  13 root root     0 Aug  7 08:42 sys drwxrwxrwt.   3 root root  4096 Sep 13 03:37 tmp drwxr-xr-x.  13 root root  4096 Mar 28 17:53 usr drwxr-xr-x.  18 root root  4096 Mar  7  2012 var
75270
In Linux, one folder is created every morning and 5 files are created in that folder.  At the end of the day (Midnight), the last two files in that folder have to be deleted. How can I accomplish this?
47010
Is there any locking on the content, imposed by the process if at all the process is using the file.  We host a JBoss app server on a RHEL 6.4 OS and due to the disk space constraints we have decided to remove the log files it generated till date.  However, if we delete the log file which is being used there could be few issues with the logging in jboss which eventually leads to the restart of Jboss App Server instance.  We we have decided to nullify the server.log which is being dynamically written by the JBoss app server process (checked with the fuser command) by using the below commands:  -- &gt; server.log -- echo "" &gt; server.log   None of the above commands worked. The size of the files still shows 500+ MB  How do I remove the contents of the file without deleting the file?
108448
Is there a way to hide all file extensions like in Windows?
3434
This is a  about how Unix operating systems report memory usage.   Similar Questions:                    I have production server that is running Debian 6.0.6 Squeeze  #uname -a  Linux debsrv 2.6.32-5-xen-amd64 #1 SMP Sun Sep 23 13:49:30 UTC 2012 x86_64 GNU/Linux   Every day cron executes backup script as root:  #crontab -e  0 5 * * * /root/sites_backup.sh &gt; /dev/null 2&gt;&amp;1   #nano /root/sites_backup.sh  #!/bin/bash str=`date +%Y-%m-%d-%H-%M-%S` tar pzcf /home/backups/sites/mysite-$str.tar.gz /var/sites/mysite/public_html/www mysqldump -u mysite -pmypass mysite | gzip -9 &gt; /home/backups/sites/mysite-$str.sql.gz cd /home/backups/sites/ sha512sum mysite-$str* &gt; /home/backups/sites/mysite-$str.tar.gz.DIGESTS cd ~   Everything works perfectly, but I notice that Munin's memory graph shows increase of cache and buffers after backup.  Then I just download backup files and delete them. After deletion Munin's memory graph returns cache and buffers to the state that was before backup.  Here's Munin graph:  Externally hosted image was a dead link.
1657
How to know in Linux whether a particular file is compressed or not using a command?
13467
We have an Apache setup with a huge disk_cache (>500.000 entries, >50 GB disk space used). The cache grows by 16 GB every day.  My problem is that the cache seems to be growing nearly as fast as it's possible to remove files and directories from the cache filesystem!  The cache partition is an ext3 filesystem (100GB, "-t news") on an iSCSI storage. The Apache server (which acts as a caching proxy) is a VM. The disk_cache is configured with CacheDirLevels=2 and CacheDirLength=1, and includes variants. A typical file path is "/htcache/B/x/i_iGfmmHhxJRheg8NHcQ.header.vary/A/W/oGX3MAV3q0bWl30YmA_A.header".  When I try to call htcacheclean to tame the cache (non-daemon mode, "htcacheclean-t -p/htcache -l15G"), IOwait is going through the roof for several hours. Without any visible action. Only after hours, htcacheclean starts to delete files from the cache partition, which takes a couple more hours. (A similar problem was brought up in the Apache mailing list in 2009, without a solution: )  The high IOwait leads to problems with the stability of the web server (the bridge to the Tomcat backend server sometimes stalls).  I came up with my own prune script, which removes files and directories from random subdirectories of the cache. Only to find that the deletion rate of the script is just slightly higher than the cache growth rate. The script takes ~10 seconds to read the a subdirectory (e.g. /htcache/B/x) and frees some 5 MB of disk space. In this 10 seconds, the cache has grown by another 2 MB. As with htcacheclean, IOwait goes up to 25% when running the prune script continuously.  Any idea?   Is this a problem specific to the (rather slow) iSCSI storage? Should I choose a different file system for a huge disk_cache? ext2? ext4? Are there any kernel parameter optimizations for this kind of scenario? (I already tried the deadline scheduler and a smaller read_ahead_kb, without effect).
83812
I stupidly ran sudo rm /* followed by sudo rm -R /*  My sites still run, although the vast majority of commands like ls are now broken.  Is there a simple way to get data off the server or reverse some of damage?
71104
Possible Duplicate:          Hi,  Is there any simple way to undo an rm command?  The question is purely theoretical; I have NEVER deleted the log of a benchmark queue who took a whole lunchtime to run.