Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
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 Jun 26 '12 at 16:28

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.