The --
(double dash) in a command-line shell like Secure Shell (SSH) is used to indicate the end of options and the beginning of arguments. It is often used to specify arguments that begin with a dash (-
) without having them interpreted as options.
For example, consider the following ssh
command:
ssh user@example.com -p 22 -- ls -l
In this command, ssh
is the command, user@example.com
is the remote host to connect to, and -p 22
is the option to specify the port number to use. The --
indicates the end of options, and the ls -l
arguments specify the command to run on the remote host.
Without the --
, the ls -l
arguments would be interpreted as options, which would result in an error. By using the --
, the ls -l
arguments are passed as-is to the ssh
command, and the ls
command is run with the -l
option on the remote host.
The --
is a standard shell feature and is not specific to the ssh
command. It can be used with other commands as well to specify the end of options and the beginning of arguments.
You can find more information about the --
option and other shell features in the documentation for your shell.