LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-09-2014, 09:26 PM   #1
phillyfilly
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Rep: Reputation: Disabled
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

Last edited by phillyfilly; 02-09-2014 at 09:27 PM.
 
Old 02-09-2014, 09:39 PM   #2
m.a.l.'s pa
Member
 
Registered: Oct 2007
Location: albuquerque
Posts: 228

Rep: Reputation: 62
Code:
$ df -h -
df: -: No such file or directory
 
1 members found this post helpful.
Old 02-09-2014, 09:42 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,332
Blog Entries: 1

Rep: Reputation: 2329Reputation: 2329Reputation: 2329Reputation: 2329Reputation: 2329Reputation: 2329Reputation: 2329Reputation: 2329Reputation: 2329Reputation: 2329Reputation: 2329
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.
 
1 members found this post helpful.
Old 02-09-2014, 09:50 PM   #4
m.a.l.'s pa
Member
 
Registered: Oct 2007
Location: albuquerque
Posts: 228

Rep: Reputation: 62
Quote:
Originally Posted by phillyfilly View Post
php -v
php -v - what does v mean?
As copied right from man php:

Code:
-v

Version number
 
Old 02-09-2014, 10:38 PM   #5
phillyfilly
LQ Newbie
 
Registered: Feb 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thank you. There are lots of v's. I thought it meant verbose, but that made no sense.

Last edited by phillyfilly; 02-09-2014 at 10:39 PM.
 
Old 02-10-2014, 01:44 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,362

Rep: Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377Reputation: 2377
It varies for every cmd; just read the man page, either on your system 'man <cmd>' or here http://linux.die.net/man/
 
Old 02-10-2014, 02:33 AM   #7
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 9,350

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
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:
Description

grep searches the named input FILEs (or standard input if no files are named, or if a single hyphen-minus (-) is given as file name) for lines containing a match to the given PATTERN. ...
 
Old 02-10-2014, 05:35 AM   #8
yooden
Member
 
Registered: Dec 2013
Distribution: Debian Wheezy/Jessie # XFCE
Posts: 53

Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
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).
Not really, see bash(1), su(1).

Your first advice fits: Check the manpage.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Minus sign in 'if' statement unclear keif Programming 3 10-18-2013 03:20 PM
[SOLVED] CTRL + Minus sign drManhattan SUSE / openSUSE 6 08-16-2011 09:20 AM
cd to a directory name - (minus sign) anjanesh Linux - General 4 12-29-2008 03:38 AM
Removing a directory beginning with a minus sign. harry edwards Linux - General 4 03-01-2008 05:44 PM
how to delete file which name start with minus sign? guillaume31 Linux - General 3 01-27-2005 07:15 AM


All times are GMT -5. The time now is 08:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration