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

New Maintainer for CommandLineFu
Welcome to Jon H. (@fart), the new maintainer of CommandLineFu. . In the absence of a forum, I encourage people welcome him, here, in the comments. . Also... What would you like to improve/change about the site?

Length of longest line of code
Here's an awk version.

relabel current konsole tab
usage: renam in a script you must replace $PPID with $(awk '{print $4}' /prod/$PPID/stat)

Download all music files off of a website using wget
This will download all files of the type specified after "-A" from a website. Here is a breakdown of the options: -r turns on recursion and downloads all links on page -l1 goes only one level of links into the page(this is really important when using -r) -H spans domains meaning it will download links to sites that don't have the same domain -nd means put all the downloads in the current directory instead of making all the directories in the path -A mp3 filters to only download links that are mp3s(this can be a comma separated list of different file formats to search for multiple types) -e robots=off just means to ignore the robots.txt file which stops programs like wget from crashing the site... sorry http://example/url lol..

delete files containing matching text
-r recursively -Z zero byte after each file name instead of the usual newline -l only filenames

Terminal Keyboard Shortcut list
This command will give you a list of available keyboard shortcuts according to stty.

convert doc to pdf
convert to pdf and many other formats and vise versa to get a list of supported formats, run $ unoconv --show

statistics in one line
In this example, file contains five columns where first column is text. Variance is calculated for columns 2 - 5 by using perl module Statistics::Descriptive. There are many more statistical functions available in the module.

Count number of files in subdirectories
For each directory from the current one, list the counts of files in each of these directories. Change the -maxdepth to drill down further through directories.

Function to output an ASCII character given its decimal equivalent
I've corrected the function. My octal conversion formula was completely wrong. Thanks to pgas at for setting me straight. The new function is from pgas and is very fast.

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: