The difference a minus sign makes
What is the difference between these two lines? What does the minus sign at the end do, or don't do? I am running Fedora 20 -64 bit - on VMware Workstation 10. Thank you very much.
df -h df -h - php -v php -v - what does v mean? rpm -qa rpm -qa - what does -q-a mean? mySQL -v mySQL -v - same question mySQL -V mySQL -V - same question |
Code:
$ df -h - |
It has no general or special meaning, it is just another shell argument.
What it does depends on the program or command being invoked. Some, such as su define the trailing dash to have a particular meaning. Others do not, and simply ignore it, such as your php and mysql examples. If you type the df -h - example you will see that it is rejected as an invalid path spec. |
Quote:
Code:
-v |
Thank you. There are lots of v's. I thought it meant verbose, but that made no sense.
|
It varies for every cmd; just read the man page, either on your system 'man <cmd>' or here http://linux.die.net/man/
|
there are some common flags, like -v means -verbose or -version, -l means long format, -h help, but you always need to check the manual page, because they may have different meaning.
The - (minus) sign usually means the actual process will use stdin as input instead of a file. Is accepted only where it has any meaning (df need no input file). see for example man grep: Quote:
|
Quote:
Your first advice fits: Check the manpage. |
All times are GMT -5. The time now is 04:29 AM. |