LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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
Distribution: Debian, Arch, Kubuntu
Posts: 366

Rep: Reputation: 139Reputation: 139
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<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196
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
Distribution: Debian, Arch, Kubuntu
Posts: 366

Rep: Reputation: 139Reputation: 139
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: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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 Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,930

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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:46 AM.

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
Open Source Consulting | Domain Registration