In htop, or other commands that show process status, all bash processes have in the command column
but one process has in the command column
What does it mean?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
A minus sign before the command name is a convention that login programs use to start login shells. A login program is a program where you typically type your password and that starts a session for you, such as
su -, sshd, etc. A login shell is the initial shell of a text mode session.
Conventionally, when a program invokes another program, it passes the program's name as argument 0; command line arguments are numbered starting from 1. For example, when you run
cp foo bar, this executes the executable file located at
/bin/cp (on typical systems), and passes
cp as argument 0,
foo as argument 1 and
bar as argument 2. The normal convention is to use the base name of the executable as argument 0. When a login program invokes a shell, it violates this convention and puts an extra hyphen before the program name. Shells understand this alternate convention and set things up appropriately for a login shell, typically reading an initialization file such as
~/.bash_profile, etc. depending on the shell.