Commands tagged kernel (37)

  • 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....


    0
    sudo dpkg -i `ls -tr *.deb | tail -n4`
    _john · 2011-10-09 14:20:11 3
  • Gets the (previously obtainable with: finger @kernel.org ) info of the latest linux kernel versions available. Show Sample Output


    0
    curl 'https://www.kernel.org/kdist/finger_banner'
    Testuser_01 · 2012-03-04 21:10:19 4
  • Well, this is quite useful for testing if your hardware watchdog is working properly.


    0
    echo c > /proc/sysrq-trigger
    fangfufu · 2013-05-07 19:41:40 6
  • echo 1 > /proc/sys/sunrpc/nfs_debug && tail -f /var/log/messages to debug NFS issues.


    0
    echo 1 > /proc/sys/sunrpc/nfs_debug
    harpo · 2014-08-12 14:40:55 9
  • Get newest kernel version by parsing the most bleeding-edge Makefile possible. Useful for doing things like writing live ebuilds and/or self-updating PKGBUILDs for testing purposes. Breakdown: * wget -qO - https://raw.githubusercontent.com/torvalds/linux/master/Makefile — retrieve Makefile and pipe to stdout * head -n5 — only the first 5 lines are relevant, that's where all the version variables are grep -E '\ \=\ [0-9]{1,}' — version variables always have an equals sign followed by a number * cut -d' ' -f3 — extract the individual numbers from the version variables * tr '\n' '.' — replace newlines with periods * sed -e "s/\.$// — remove trailing period Show Sample Output


    0
    wget -qO - https://raw.githubusercontent.com/torvalds/linux/master/Makefile | head -n5 | grep -E '\ \=\ [0-9]{1,}' | cut -d' ' -f3 | tr '\n' '.' | sed -e "s/\.$//"
    realkstrawn93 · 2021-04-27 17:12:05 416
  • Kernel developers might need to know what indices to map to the IOAPIC if building a new kernel from scratch. This command gives users a guide to go off of.


    0
    cp /proc/interrupts irq-ref.txt
    realkstrawn93 · 2022-02-23 19:53:02 504
  • Whenever you compile a new kernel, there are always new modules. The best way to make sure you have the correct modules loaded when you boot is to add all your modules in the modules.autoload file (they will be commented) and uncomment all those modules you need. Also a good way to keep track of the available modules in your system. For other distros you may have to change the name of the file to /etc/modprobe.conf Show Sample Output


    -1
    find /lib/modules/`uname -r`/ -type f -iname '*.o' -or -iname '*.ko' |grep -i -o '[a-z0-9]*[-|_]*[0-9a-z]*\.ko$' |xargs -I {} echo '# {}' >>/etc/modules.autoload.d/kernel-2.6
    paragao · 2010-01-13 02:12:08 4
  • Disable randomisation address Show Sample Output


    -1
    echo 0 > /proc/sys/kernel/randomize_va_space
    gunslinger_ · 2010-07-11 16:42:42 3
  • Same as 7272 but that one was too dangerous so i added -P to prompt users to continue or cancel 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).


    -1
    sudo aptitude remove -P $(dpkg -l|awk '/^ii linux-image-2/{print $2}'|sed 's/linux-image-//'|awk -v v=`uname -r` 'v>$0'|sed 's/-generic//'|awk '{printf("linux-headers-%s\nlinux-headers-%s-generic\nlinux-image-%s-generic\n",$0,$0,$0)}')
    Bonster · 2011-04-25 05:19:57 3
  • Fetches latest stable release version from first entry between tags Show Sample Output


    -1
    curl -s -k https://www.kernel.org/feeds/kdist.xml | sed -n -e 's@.*<guid>\(.*\)</guid>.*@\1@p' | grep 'stable' | head -1 | awk -F , '{print $3}'
    Wafelijzer · 2013-12-17 23:59:27 7

  • -4
    aptitude purge linux-image | grep ^i | grep -v $(uname -r)
    lgallardo · 2010-06-11 22:20:42 5
  • Display the machine "hardware name" 32 or 64 bit. "x86_64" is shown on 64 bit machines "i686" is typically shown on 32 bit machines (although, you might also see "i386" or "i586" on older Linuxen). On other "unix-like" systems, other hardware names will be displayed. For example, on AIX, "uname -m" gives the "machine sequence number". For whatever reason, IBM decided that "uname -M" would give the machine type and model. (ref: http://www.ibm.com/developerworks/aix/library/au-aix-systemid.html ) On Sun Solaris, "uname -m" can be used to determine the chip type and "isainfo -v" will reveal if the kernel is 64 or 32 bit. (ref: http://www.ibiblio.org/pub/packages/solaris/sparc/html/32.and.64.bit.packages.html ) A more reliable way to determine "64-bit ness" across different Unix type systems is to compile the following simple C program: cat <<eeooff > bits.c /* * program bits.c * purpose Display "32" or "64" according to machine type * written January 2013 * reference http://www.unix.org/whitepapers/64bit.html */ /* hmm, curious that angle-brackets removed by commandlinefu.com data input processing? */ #include "/usr/include/stdio.h" long lv = 0xFFFFFFFF; main ( ) { printf("%2d\n",(lv < 0)?32:64); } eeooff Compile and run thusly: cc -o bits bits.c; ./bits Show Sample Output


    -4
    uname -m # display machine "hardware name"
    mpb · 2013-01-04 11:46:43 15
  •  < 1 2

What's this?

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.

Share Your Commands


Check These Out

Mac Sleep Timer
Schedule your Mac to sleep at any future time. Also wake, poweron, shutdown, wakeorpoweron. Or repeating with $ sudo pmset repeat wakeorpoweron MTWRFSU 7:00:00 Query with $ pmset -g sched Lots more at http://www.macenterprise.org/articles/powermanagementandschedulingviathecommandline

cd to (or operate on) a file across parallel directories
This is useful for quickly jumping around branches in a file system, or operating on a parellel file. This is tested in bash. cd to (substitute in PWD, a for b) where PWD is the bash environmental variable for the "working directory"

Clear filesystem memory cache
Found here: http://ubuntuforums.org/showthread.php?t=589975

Prevent non-root users from logging in
Also with optional message: $ echo "no login for you" > /etc/nologin (This doesn't affect your current X session - you're already logged in!)

Convert seconds to [DD:][HH:]MM:SS
Converts any number of seconds into days, hours, minutes and seconds. sec2dhms() { declare -i SS="$1" D=$(( SS / 86400 )) H=$(( SS % 86400 / 3600 )) M=$(( SS % 3600 / 60 )) S=$(( SS % 60 )) [ "$D" -gt 0 ] && echo -n "${D}:" [ "$H" -gt 0 ] && printf "%02g:" "$H" printf "%02g:%02g\n" "$M" "$S" }

cat stdout of multiple commands

Sprunge.us - CLI alternative to PasteBin.com
NAME sprunge: command line pastebin: SYNOPSIS | curl -F 'sprunge=

Find out how much ram memory has your video (graphic) card

Install pip with Proxy
Installs pip packages defining a proxy

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: