The "bad syntax, perhaps a bogus '-'?" error message is commonly seen when using the ps
command on Linux systems. This error is usually caused by using an invalid option or flag with the ps
command.
The ps
command has a number of options and flags that can be used to control its behavior. Some of these options are single-letter options (e.g., -e
), while others are multi-letter options (e.g., --format
).
If you see the "bad syntax" error message when using the ps
command, it means that you have used an invalid option or flag. This can be caused by either typing the option incorrectly, or using a flag that is not supported by the ps
command.
To fix this error, you need to check the syntax of the ps
command and ensure that you are using the correct options and flags. You can also refer to the ps
man page or the /usr/share/doc/procps-3.2.7/FAQ
file for more information about the available options and flags for the ps
command.
To view the ps
man page, you can use the man
command, like this:
man ps
To view the /usr/share/doc/procps-3.2.7/FAQ
file, you can use the less
command, like this:
less /usr/share/doc/procps-3.2.7/FAQ
Alternatively, you can also use the --help
flag with the ps
command to view a list of available options and flags.
ps --help
This will display a list of options and flags that can be used with the ps
command, along with a brief description of each one.