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 415
  • 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 496
  • 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

Transfer SSH public key to another machine in one step
This command sequence allows simple setup of (gasp!) password-less SSH logins. Be careful, as if you already have an SSH keypair in your ~/.ssh directory on the local machine, there is a possibility ssh-keygen may overwrite them. ssh-copy-id copies the public key to the remote host and appends it to the remote account's ~/.ssh/authorized_keys file. When trying ssh, if you used no passphrase for your key, the remote shell appears soon after invoking ssh user@host.

Write comments to your history.
A null operation with the name 'comment', allowing comments to be written to HISTFILE. Prepending '#' to a command will *not* write the command to the history file, although it will be available for the current session, thus '#' is not useful for keeping track of comments past the current session.

Read aloud a text file in Mac OS X

Count number of files in a directory
Just want to post a Perl alternative. Does not count hidden files ('.' ones).

Download all PDFs from an authenificated website
Replace *** with the appropiate values

Multi-thread any command
For instance: $ find . -type f -name '*.wav' -print0 |xargs -0 -P 3 -n 1 flac -V8 will encode all .wav files into FLAC in parallel. Explanation of xargs flags: -P [max-procs]: Max number of invocations to run at once. Set to 0 to run all at once [potentially dangerous re: excessive RAM usage]. -n [max-args]: Max number of arguments from the list to send to each invocation. -0: Stdin is a null-terminated list. I use xargs to build parallel-processing frameworks into my scripts like the one here: http://pastebin.com/1GvcifYa

disable caps lock
a quick one-line way to disable caps lock while running X.

Get a qrcode for a given string

Setting reserved blocks percentage to 1%
According to tune2fs manual, reserved blocks are designed to keep your system from failing when you run out of space. Its reserves space for privileged processes such as daemons (like syslogd, for ex.) and other root level processes; also the reserved space can prevent the filesystem from fragmenting as it fills up. By default this is 5% regardless of the size of the partition. http://www.ducea.com/2008/03/04/ext3-reserved-blocks-percentage/

Show apps that use internet connection at the moment.
show only the name of the apps that are using internet


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: