Needed a quick way to see if my server distro that I setup years ago was running 32bit or not, since with time I had forgotten. Note: does not check _hardware_ e.g. /proc/cpuinfo but rather the kernel installed Show Sample Output
This should do the same thing and is about 70 chars shorter. Show Sample Output
Note the double space: "...^ii␣␣linux-image-2..." Like 5813, but fixes two bugs: [1]This leaves the meta-packages 'linux-headers-generic' and 'linux-image-generic' alone so that automatic upgrades work correctly in the future. [2]Kernels newer than the currently running one are left alone (this can happen if you didn't reboot after installing a new kernel). I'm bummed that this took 228 characters. I'd like to see a simpler version. Show Sample Output
Use `sysctl -p` without argument will only load /etc/sysctl.conf, but user configs always put in /etc/sysctl.d/*.conf, `sysctl --system` will load all the config files
depends on "jq" This is more reliable in my opinion. Show Sample Output
This will remove all installed kernels on your debian based install, except the one you're currently using. From: http://tuxtweaks.com/2009/12/remove-old-kernels-in-ubuntu/comment-page-1/#comment-1590
Lists all installed kernels minus the current one. This is useful to uninstall older kernels that take too much space on /boot partition. Show Sample Output
Remove old kernels (*-generic and *-generic-pae) via apt-get on debian/ubuntu based systems. Tested on ubuntu 10.04 - 12.04.
Lockstat will sample the kernel 977 times per second, and print out the functions that it sees executing on the CPU during the sample. The -s 10 switch tells lockstsat to not only print that function, but also show the call stack (up to 10 deep). Show Sample Output
A little aptitude magic. Note: this will remove images AND headers. If you just want to remove images: aptitude remove ?and(~i~nlinux-im ?not(~n`uname -r`)) I used this in zsh without any problems. I'm not sure how other shells will interpret some of the special characters used in the aptitude search terms. Use -s to simulate.
These are way better than fortune(6). Show Sample Output
TIMTOWTDI
Use modprobe to list all the dependencies of a certain kernel module. Handy when debugging system issues. Show Sample Output
This is likely only valid on Solaris based systems. Unfortunately a lot of the more universal techniques for determining if a system is 32bit or 64bit on x86 solaris fail to give much more information than "i86pc" Show Sample Output
Reload all defined kernel variables from /etc/sysctl.conf(if no parameter after -p is given) without the old myth "Ah, you'll need to reboot to apply those variables"... Show Sample Output
Returns the version of the kernel module specified as "MODULENAME", when available. Show Sample Output
Linux offers an interesting option to restrict the use of dmesg. It is available via /proc/sys/kernel/dmesg_restrict.
You can check the status with:
cat /proc/sys/kernel/dmesg_restrict
Alternatively you can use sysctl:
sudo sysctl -w kernel.dmesg_restrict=1
To make your change persistent across reboot, edit a fille in /etc/sysctl.d/.
If, for example, you want to remove all kernels and headers but the last three versions, you can't use one of that magic all-in-one "remove old stuff" commands. With this simple but elegant command you can remove a range of versions, or a list of versions with e.g. {14,16,20}. Show Sample Output
zless /proc/config.gz
Then exit from the shell.
exit
some time need to exit twice
exit
exit
Now the OS will boot with the new parameters.
since awk was already there one can use it instead of the 2 greps. might not be faster, but fast enough
after kernel build with make deb-pkg, I like to install the 4 newest packages that exist in the directory. Beware: might be fewer for you....
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: