1

I tend to use su - loginname -c somecommand. Any different having argument -l? That is su -l loginname -c somecommand?

Lesmana
  • 27,439

1 Answers1

1

The man page for su my Linux has, puts - and -l as equivalent, except for a minor difference in how su parses its command line.

-, -l, --login Provide an environment similar to what the user would expect had the user logged in directly.

When - is used, it must be specified before any username. For portability it is recommended to use it as last option, before any username. The other forms (-l and --login) do not have this restriction.

ilkkachu
  • 138,973