UNIX: Switching Users with su
-
@BRRABill Exactly! Inquiring minds want to know
-
@BRRABill said in UNIX: Switching Users with su:
And why is it sometimes
one dash
One dash is normally used for "shorthand", or shorted operators for the different programs. IE
ls -ha
-h is really --human-readable being passed to ls and
-a is really --all being passed to lsand other times
two dashes
Two dashes are normally "long form", see my previous ls example.
for other commands?
It's really just up to whoever wrote the program. For example, mdadm has lots and lots of optional command line switches. Because of how many long form options mdadm has, very few can be a single letter and still have each option be unique.
I'm sure I've got the details wrong and @scottalanmiller will pipe in sometime soon.
-
@travisdh1 said in UNIX: Switching Users with su:
@BRRABill said in UNIX: Switching Users with su:
And why is it sometimes
one dash
One dash is normally used for "shorthand", or shorted operators for the different programs. IE
ls -ha
-h is really --human-readable being passed to ls and
-a is really --all being passed to lsand other times
two dashes
Two dashes are normally "long form", see my previous ls example.
for other commands?
It's really just up to whoever wrote the program. For example, mdadm has lots and lots of optional command line switches. Because of how many long form options mdadm has, very few can be a single letter and still have each option be unique.
I'm sure I've got the details wrong and @scottalanmiller will pipe in sometime soon.
Will | in very soon?
-
@BRRABill said in UNIX: Switching Users with su:
@travisdh1 said in UNIX: Switching Users with su:
@BRRABill said in UNIX: Switching Users with su:
And why is it sometimes
one dash
One dash is normally used for "shorthand", or shorted operators for the different programs. IE
ls -ha
-h is really --human-readable being passed to ls and
-a is really --all being passed to lsand other times
two dashes
Two dashes are normally "long form", see my previous ls example.
for other commands?
It's really just up to whoever wrote the program. For example, mdadm has lots and lots of optional command line switches. Because of how many long form options mdadm has, very few can be a single letter and still have each option be unique.
I'm sure I've got the details wrong and @scottalanmiller will pipe in sometime soon.
Will | in very soon?
I'm so puny I don't even know it!
-
@BRRABill said in UNIX: Switching Users with su:
And why is it sometimes
one dash
and other times
two dashes
for other commands?
Because "commands" aren't really what they are. They are independent applications. There are conventions but that is all that they are.
-
@Grey said in UNIX: Switching Users with su:
Pop quiz: why do you need the dash with su?
Still no answers for this... hint: it has to do with environment.
-
@Grey said in UNIX: Switching Users with su:
@Grey said in UNIX: Switching Users with su:
Pop quiz: why do you need the dash with su?
Still no answers for this... hint: it has to do with environment.
Because it provides the user the full environmental experience of the new identity. For this reason, su is almost always used with a hyphen.
-
@DustinB3403 said in UNIX: Switching Users with su:
@Grey said in UNIX: Switching Users with su:
@Grey said in UNIX: Switching Users with su:
Pop quiz: why do you need the dash with su?
Still no answers for this... hint: it has to do with environment.
Because it provides the user the full environmental experience of the new identity. For this reason, su is almost always used with a hyphen.
Exactly! Lots of linux n00bs skip the dash and it's amazing to see the confusion when things just "aren't right" as they're working in the shell.
-
@Grey said in UNIX: Switching Users with su:
Pop quiz: why do you need the dash with su?
That was in the original article.
-
@scottalanmiller said in UNIX: Switching Users with su:
@Grey said in UNIX: Switching Users with su:
Pop quiz: why do you need the dash with su?
That was in the original article.
And I quoted you without quoting you..... see what I did there, I switched a few words
-