Use of hyphen in shell command

Posted by deanloh on Server Fault See other posts from Server Fault or by deanloh
Published on 2010-05-14T03:05:41Z Indexed on 2010/05/14 3:14 UTC
Read the original article Hit count: 190

Filed under:
|

I feel shy to ask this question, but if I don't I will never know, so here I am giving it a shot:

I notice most shell commands use "-" for options, but I also noticed some commands do not have it. For example, to archive files in a given direct, the command is:

tar czvf allmyfiles.tar.gz *

However, to extract an archive, the command I learned, is:

tar -zxvf allmyfiles.tar.gz

Looking at both examples above, is there any significance whether to include the hyphen or not?

© Server Fault or respective owner

Related posts about shell

Related posts about command-line