Commands tagged grub (7)

  • This will reboot as the Grub 2 option.

    echo "savedefault --default=2 --once" | grub --batch; sudo reboot
    matthewbauer · 2010-05-02 03:06:23 0
  • look at /boot/grub/menu.lst for somethig like: ## additional options to use with the default boot option, but not with the ## alternatives ## e.g. defoptions=vga=791 resume=/dev/hda5 ## defoptions=vga=795 # defoptions=vga=873 ## altoption boot targets option ## multiple altoptions lines are allowed ## e.g. altoptions=(extra menu suffix) extra boot options ## altoptions=(recovery) single # altoptions=(verbose mode) vga=775 debug # altoptions=(console mode) vga=ask # altoptions=(graphic mode) quiet splash # altoptions=(recovery mode) single vga=(decimal value) is framebuffer mode Show Sample Output

    sudo hwinfo --framebuffer
    hute37 · 2010-10-03 14:45:02 0
  • * size must be 640?480 pixels * only has 14 colors * save it in XPM format Edit /boot/grub/menu.lst and add splashimage=(hd0,0)/boot/grub/grubimg.xpm make sure for your path name and hard disk

    convert image123.png -colors 14 -resize 640x480 grubimg.xpm
    starchox · 2009-03-12 22:55:10 1
  • I like to label my grub boot options with the correct kernel version/build. After building and installing a new kernel with "make install" I had to edit my grub.conf by hand. To avoid this, I've decided to write this little command line to: 1. read the version/build part of the filename to which the kernel symlinks point 2. replace the first label lines of grub.conf grub.conf label lines must be in this format: Latest [{name}-{version/build}] Old [{name}-{version/build}] only the {version/build} part is substituted. For instance: title Latest [GNU/Linux-2.6.31-gentoo-r10.201003] would turn to title Latest [GNU/Linux-2.6.32-gentoo-r7.201004]"

    LATEST=`readlink /boot/vmlinuz`; OLD=`readlink /boot/vmlinuz.old`; cat /boot/grub/grub.conf | sed -i -e 's/\(Latest \[[^-]*\).*\]/\1-'"${LATEST#*-}"]'/1' -e 's/\(Old \[[^-]*\).*\]/\1-'"${OLD#*-}"]'/1' /boot/grub/grub.conf
    algol · 2010-04-21 19:16:51 0
  • If you don't want your computer to try to boot form a USB stick that used to be used as a boot device (maybe for a live linux distro), you will have to remove the boot loader from your stick other wise the boot will fail each time the device is attached to your PC.

    dd if=/dev/zero of=/dev/sdb bs=446 count=1
    dcabanis · 2009-06-07 10:29:49 1
  • Then exit from the shell. exit some time need to exit twice exit exit Now the OS will boot with the new parameters.

    echo "root=/dev/sda7" > /proc/param.conf
    totti · 2011-09-27 18:06:53 1
  • From live CD mount(open) the Ubuntu installed drive. Copy the location (press Ctrl+l, Ctrl+c ) eg: /media/ubuntuuuu Open terminal (Apllication->accessories->terminal) Type this: sudo grub-install --root-directory=/media/ubuntuuuu /dev/sda (replace /media/ubuntuuuu with what u got (ie paste)) Will show success message. Now reboot

    sudo grub-install --root-directory=/media/ubuntu /dev/sda
    totti · 2011-09-27 17:51:56 0

What's this? 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

Show max lengths of all fields in a pipe delimited file with header row

Quick calculator at the terminal
Useful for quick calculations at the command line. $math_expr is any arithmetic expression (see sample output): 4.5*16+3^2 s(3.1415926/2) More options in the bc man page.

Set laptop display brightness
Run as root. Path may vary depending on laptop model and video card (this was tested on an Acer laptop with ATI HD3200 video). $ cat /proc/acpi/video/VGA/LCD/brightness to discover the possible values for your display.

Extract audio from Mythtv recording to Rockbox iPod using ffmpeg
There are some pretty good live performances on late night TV. With Mythtv I record David Letterman, Jimmy Fallon, and Conan nightly all in HD from over the air broadcasts. If I find a live performance I like I copy it to my Rockboxed iPod using this command. The Rockbox firmware knows how to downmix 5.1 audio. The command above extracts the audio from the video starting at 58 minutes and 15 seconds. It ends at the end of the file since this was the last performance of the recording. The command creates an ac3 file. I copy the ac3 file to my Rockbox iPod and rock on.

import gpg key from the web
imports a public key from the web. I know this by head.. but useful nevertheless

Display summary of git commit ids and messages for a given branch
In color. Additionally you may define in your ~/.gitconfig and run it just as 'git one': one = log --pretty='format:%Cgreen%H %Cred%ai %Creset- %s'

Erase to factory a pendrive, disk or memory card, and watch the progress

Avoids ssh timeouts by sending a keep alive message to the server every 60 seconds
ssh_config is the system-wide configuration file for ssh. For per-user configuration, which allows for different settings for each host: $echo 'ServerAliveInterval 60' >> ~/.ssh/ssh_config On OSX: $echo 'ServerAliveInterval 60' >> ~/.ssh/config or $echo 'ServerAliveInterval 60' >> ~/etc/ssh_config

user 'tr' to convert mixed case in a file to lower case
convert mixed case in a file to lower case

Search from the command line using the API
Usage: cmdfu hello world

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.


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: