6

I've been customising some kernel parameters and notice that on some guides it has something like

initrd=/blahblah.gz -- quiet

and others only have

initrd=/blahblah.gz quiet

I've tried both and noticed no difference - is there one? if so, what does the double dash do?

1
  • 4
    In commands, -- is often used to stop the command from processing "flags" and only process "parameters" (like filenames) after that. In Grub or other bootloaders, I'm not sure what the significance is.
    – killermist
    Commented Jun 26, 2012 at 16:28

1 Answer 1

5

Let's suppose you want to pass a file as the parameter to the kernel. The filename of a file contains a dash at the first character of the filename (i.e. -Justin). If you'd write:

kernel-2.3.4 -Justin --

then -Justin would be treated as a kernel _parameter_ (or maybe I should say, 'a flag', as killermist wrote it). Thank God, such parameter (such flag) does not exist.

If on the other hand, you'd write:

kernel-2.3.4 -- -Justin

then '-Justin` would be treated as an actual _file[name]_.

kernel-2.3.4 -param1 -param2 -param3 -- file1 file2 -Justin

If you invoke a program from the command line, -- is used to inform a program, that _after_ -- there will only be filenames / some other objects (objects different than the 'native' switches for the program - by native switches i mean i.e. -a -b -c -s etc.).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .