What is meaning of double hyphen (--) in ls command [duplicate] The 2019 Stack Overflow Developer Survey Results Are InWhat does “--” (double-dash) mean? (also known as “bare double dash”)General specification for command line interfaceRegular Expression for finding double characters in BashHow to find certain files and move them to a new directory in the same command?Is there a single '03 registered UNIX which can't do rm — -foo at this point?What is the concept hidden behind the term “command”?Using double or no quotes with wildcardsWhat is happening behind the scenes for these basic Unix commands?Command to know if file is createdSome questions regarding pr commandDoes a Linux command called (h) exist?
If a poisoned arrow's piercing damage is reduced to 0, do you still get poisoned?
Why is it "Tumoren" and not "Tumore"?
Idiomatic way to prevent slicing?
How to make payment on the internet without leaving a money trail?
If the Wish spell is used to duplicate the effect of Simulacrum, are existing duplicates destroyed?
Manuscript was "unsubmitted" because the manuscript was deposited in Arxiv Preprints
Limit the amount of RAM Mathematica may access?
What is the use of option -o in the useradd command?
Extreme, unacceptable situation and I can't attend work tomorrow morning
What is a mixture ratio of propellant?
Time travel alters history but people keep saying nothing's changed
Why do UK politicians seemingly ignore opinion polls on Brexit?
Geography at the pixel level
Is bread bad for ducks?
Could JWST stay at L2 "forever"?
Why Did Howard Stark Use All The Vibranium They Had On A Prototype Shield?
Can we apply L'Hospital's rule where the derivative is not continuous?
Patience, young "Padovan"
In microwave frequencies, do you use a circulator when you need a (near) perfect diode?
Evaluating number of iteration with a certain map with While
How can I fix this gap between bookcases I made?
Does light intensity oscillate really fast since it is a wave?
Does duplicating a spell with Wish count as casting that spell?
I see my dog run
What is meaning of double hyphen (--) in ls command [duplicate]
The 2019 Stack Overflow Developer Survey Results Are InWhat does “--” (double-dash) mean? (also known as “bare double dash”)General specification for command line interfaceRegular Expression for finding double characters in BashHow to find certain files and move them to a new directory in the same command?Is there a single '03 registered UNIX which can't do rm — -foo at this point?What is the concept hidden behind the term “command”?Using double or no quotes with wildcardsWhat is happening behind the scenes for these basic Unix commands?Command to know if file is createdSome questions regarding pr commandDoes a Linux command called (h) exist?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
This question already has an answer here:
What does “--” (double-dash) mean? (also known as “bare double dash”)
4 answers
I was looking for command to print only directory names in linux. I came across this novel syntax, where we can put two hyphens adjacent without any word.
ls -ld -- */
What is the meaning of this double hyphen (--) in this command and in general in linux commands?
linux shell command
New contributor
pzk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
marked as duplicate by muru, Kusalananda♦
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Apr 6 at 7:22
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
What does “--” (double-dash) mean? (also known as “bare double dash”)
4 answers
I was looking for command to print only directory names in linux. I came across this novel syntax, where we can put two hyphens adjacent without any word.
ls -ld -- */
What is the meaning of this double hyphen (--) in this command and in general in linux commands?
linux shell command
New contributor
pzk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
marked as duplicate by muru, Kusalananda♦
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Apr 6 at 7:22
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
What does “--” (double-dash) mean? (also known as “bare double dash”)
4 answers
I was looking for command to print only directory names in linux. I came across this novel syntax, where we can put two hyphens adjacent without any word.
ls -ld -- */
What is the meaning of this double hyphen (--) in this command and in general in linux commands?
linux shell command
New contributor
pzk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
This question already has an answer here:
What does “--” (double-dash) mean? (also known as “bare double dash”)
4 answers
I was looking for command to print only directory names in linux. I came across this novel syntax, where we can put two hyphens adjacent without any word.
ls -ld -- */
What is the meaning of this double hyphen (--) in this command and in general in linux commands?
This question already has an answer here:
What does “--” (double-dash) mean? (also known as “bare double dash”)
4 answers
linux shell command
linux shell command
New contributor
pzk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
pzk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited Apr 6 at 7:00
Rui F Ribeiro
42k1483142
42k1483142
New contributor
pzk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Apr 6 at 6:40
pzkpzk
52
52
New contributor
pzk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
pzk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
pzk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
marked as duplicate by muru, Kusalananda♦
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Apr 6 at 7:22
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by muru, Kusalananda♦
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Apr 6 at 7:22
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
"--" is used to mark the end of options and thus the beginning of arguments. It tells the command to treat everything following it as arguments and not as options, even if something may look like an option. This is used in several commands, not just ls.
This prevent the command from choking on arguments (eg. filenames) that begins with a hyphen (-) or two (--), which else would cause an error (no such option) or unpredictable result (if the hyphened argument actually is a valid option), because the command would try to interpret it as an option (and not as an argument).
For example, lets say one of your arguments is a file with a newspaper article:
-No Collusion, President exclaims - Washington Post.html
A preceding "--" will prevent the "-No" from being treated as an option.
This is especially important when using jokers (*) as in your example, because you'll never know beforehand if one or more of all the files from several sub-directories may begin with a hyphen.
one or more of all the files from several sub-directories may begin with a hyphen: should not matter because they will be expandedsubdirname/--foobaranyway and thus not have leading dashes?
– xenoid
Apr 6 at 7:01
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
"--" is used to mark the end of options and thus the beginning of arguments. It tells the command to treat everything following it as arguments and not as options, even if something may look like an option. This is used in several commands, not just ls.
This prevent the command from choking on arguments (eg. filenames) that begins with a hyphen (-) or two (--), which else would cause an error (no such option) or unpredictable result (if the hyphened argument actually is a valid option), because the command would try to interpret it as an option (and not as an argument).
For example, lets say one of your arguments is a file with a newspaper article:
-No Collusion, President exclaims - Washington Post.html
A preceding "--" will prevent the "-No" from being treated as an option.
This is especially important when using jokers (*) as in your example, because you'll never know beforehand if one or more of all the files from several sub-directories may begin with a hyphen.
one or more of all the files from several sub-directories may begin with a hyphen: should not matter because they will be expandedsubdirname/--foobaranyway and thus not have leading dashes?
– xenoid
Apr 6 at 7:01
add a comment |
"--" is used to mark the end of options and thus the beginning of arguments. It tells the command to treat everything following it as arguments and not as options, even if something may look like an option. This is used in several commands, not just ls.
This prevent the command from choking on arguments (eg. filenames) that begins with a hyphen (-) or two (--), which else would cause an error (no such option) or unpredictable result (if the hyphened argument actually is a valid option), because the command would try to interpret it as an option (and not as an argument).
For example, lets say one of your arguments is a file with a newspaper article:
-No Collusion, President exclaims - Washington Post.html
A preceding "--" will prevent the "-No" from being treated as an option.
This is especially important when using jokers (*) as in your example, because you'll never know beforehand if one or more of all the files from several sub-directories may begin with a hyphen.
one or more of all the files from several sub-directories may begin with a hyphen: should not matter because they will be expandedsubdirname/--foobaranyway and thus not have leading dashes?
– xenoid
Apr 6 at 7:01
add a comment |
"--" is used to mark the end of options and thus the beginning of arguments. It tells the command to treat everything following it as arguments and not as options, even if something may look like an option. This is used in several commands, not just ls.
This prevent the command from choking on arguments (eg. filenames) that begins with a hyphen (-) or two (--), which else would cause an error (no such option) or unpredictable result (if the hyphened argument actually is a valid option), because the command would try to interpret it as an option (and not as an argument).
For example, lets say one of your arguments is a file with a newspaper article:
-No Collusion, President exclaims - Washington Post.html
A preceding "--" will prevent the "-No" from being treated as an option.
This is especially important when using jokers (*) as in your example, because you'll never know beforehand if one or more of all the files from several sub-directories may begin with a hyphen.
"--" is used to mark the end of options and thus the beginning of arguments. It tells the command to treat everything following it as arguments and not as options, even if something may look like an option. This is used in several commands, not just ls.
This prevent the command from choking on arguments (eg. filenames) that begins with a hyphen (-) or two (--), which else would cause an error (no such option) or unpredictable result (if the hyphened argument actually is a valid option), because the command would try to interpret it as an option (and not as an argument).
For example, lets say one of your arguments is a file with a newspaper article:
-No Collusion, President exclaims - Washington Post.html
A preceding "--" will prevent the "-No" from being treated as an option.
This is especially important when using jokers (*) as in your example, because you'll never know beforehand if one or more of all the files from several sub-directories may begin with a hyphen.
edited Apr 6 at 6:57
answered Apr 6 at 6:52
Baard KopperudBaard Kopperud
4,50342845
4,50342845
one or more of all the files from several sub-directories may begin with a hyphen: should not matter because they will be expandedsubdirname/--foobaranyway and thus not have leading dashes?
– xenoid
Apr 6 at 7:01
add a comment |
one or more of all the files from several sub-directories may begin with a hyphen: should not matter because they will be expandedsubdirname/--foobaranyway and thus not have leading dashes?
– xenoid
Apr 6 at 7:01
one or more of all the files from several sub-directories may begin with a hyphen: should not matter because they will be expanded
subdirname/--foobar anyway and thus not have leading dashes?– xenoid
Apr 6 at 7:01
one or more of all the files from several sub-directories may begin with a hyphen: should not matter because they will be expanded
subdirname/--foobar anyway and thus not have leading dashes?– xenoid
Apr 6 at 7:01
add a comment |