6

I am new to Ubuntu and I am trying hard to understand the command line.

When I want to see the contents of a tar file I use:

tar tf tarfile.tar

But when I want to see a listing of all file if I use:

ls a filename

It says:

ls: cannot access a: No such file or directory

Why is that?

Why is the minus sign "-" required for one command and not for the other?

Dianne
  • 236

1 Answers1

10

The tar command is one of the oldest commands in *nix. It was created long long ago to do tape archives where data was stored on tape drives.

When the utility was written, the current standard of putting a dash to indicate a parameter was not yet invented.

It is optional for tar, but mandatory for almost every other command.

Marianna
  • 304