commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. 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.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
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:
where proc filesystem mounted under /proc
There are 2 alternatives - vote for the best!
The Linux kernel uses unused memory in caches. When you execute "free" you never get the "real" available memory.
run sync first to flush useful things out to disk!!!
To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
=1 --> to free pagecache
=2 --> to free dentries and inodes
=3 --> to free pagecache, dentries and inodes
If you can do better, submit your command here.
You must be signed in to comment.
Why would you want to do this?
Nice, but what would you use it for other than prettying up /usr/bin/free for management's consumption?
Buffers and caches in linux only use unused memory, i.e. memory not used by processes. So it's incorrect to think that you are making more memory available for programs by using this, in general. As soon as an application makes a big memory request, the kernel may satisfy that request by "dropping" enough buffers or cache to satisfy the request. Because unused memory is a terrible thing to waste. :-) If you do this, and then want to cache a file's contents (if there is memory available) then simply do
cat filename > /dev/nullif you run htop you can see the cache fill up as cat reads this file and automatically uses cache if it can.
bwoodacre: its news for me.
i had hope it decrease number of pagefaults
under what situation i should use this command??