Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between --parameter and -parameter?

I used git for some time now, but mostly I preferred the integration with Intelij IDEA. Now, in order to extend my knowledge and understanding of the system I decided to use the command line more. What I observed is that there are two types of parameters:

--parameter and -parameter

for example:

 git commit --amend -m "New commit message"

I observed the same approach on some linux tools.

like image 802
Olimpiu POP Avatar asked Feb 15 '14 21:02

Olimpiu POP


People also ask

What is difference between parameter and argument with example?

The values that are declared within a function when the function is called are known as an argument. Whereas, the variables that are defined when the function is declared are known as a parameter.

What is difference between variables and arguments?

Variables are used to pass the data between the activities of same project, while Arguments are used to pass the data between the workflows or projects. Arguments have global scope in a workflow or project by default unlike variables where we can define the scope for them manually as per the requirement.

What is difference between argument and logic?

Logic is the science that evaluates arguments. An argument is a group of statements including one or more premises and one and only one conclusion.


1 Answers

-- is used for multicharacter arguments, - is for singlecharacter arguments.

For example, those are in many programs equivalent:

program -h <-> program --help

The reason is, if you use -, you can specify many arguments at once, for example:

ls -lah gives a list of the directory content, all content, human-readible.

It needs to know that you don't mean the argument "--lah", but "-l -a -h"

like image 129
JiaYow Avatar answered Sep 24 '22 14:09

JiaYow