Found here: http://ubuntuforums.org/showthread.php?t=589975
"That's it. Not much to see here. The first command writes any cache data that hasn't been written to the disk out to the disk. The second command tells the kernel to drop what's cached. Not much to it. This invalidates the write cache as well as the read cache, which is why we have the sync command first. Supposedly, it is possible to have some cached write data never make it to disk, so use it with caution, and NEVER do it on a production server. You could ... but why take the risk? As long as you are running a post 2.6.16 kernel,..." Source: http://ubuntuforums.org/showpost.php?p=3621283&postcount=1
Clear Cached Memory on Ubuntu based distributions, and also display memory status. Please do not use this on a production machine unless you really really know what you are doing. Echo 3 is a kinder way of purging the memory, you can also use 'echo 2' or 'echo 1' if #1 You know what you are doing, and #2 refer to number 1 :-)
Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?
You must be signed in to comment.
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for:
cat filename > /dev/null
if you run htop you can see the cache fill up as cat reads this file and automatically uses cache if it can.