1

I am trying to learn Linux commands and a little bit exasperated with how little I am able to write a proper command even information is in front of me, or I think it is in front of me.

For example; I was trying to zip a file using the zip command, I went to the terminal and typed zip --help. It provided a lot of information, see below; enter image description here

I typed zip filename.txt(filename.txt is something I have created already and verified) and ran into errors, later when I googled I realize that I was supposed to first provide a zip file name too.

So a proper command would have been;

$zip myfile.zip filename.txt

I am sure I am overlooking the obvious, please suggest how to use the help.

Edit 1

The main reason I started asking the question because I couldn't completely figure out what grep

-q -F 'deb http://ppa.launchpad.net/aziotsdklinux/ppa-azureiot/ubuntu vivid main' /etc/apt/sources.list

Till now I could understand is that grep Searches for PATTERN in each FILE, -q stands for do it quietly and -F means string is going to be fixed but then I am getting lost at understanding what /etc/apt/sources.list does.

Edit 2 I think I got it, last part is to search the pattern in Sources.list file which is located under the apt directory which too is located under the etc directory.

2 Answers2

3

Such help is often designed to be compact, so it's most useful for users already having some experience and insight. Try man zip or info zip. If not locally, then online. There are examples there.

You can even run man man to see how this works.

Please note zip in one Linux distribution may be different than in another (e.g. it may offer you more options, command line switches). Local manual should fit whatever version you have.

There is also the POSIX standard. It requires some set of commands to be present in any compliant system and each of these commands to support some minimal set of options. As far as I know zip is not required by POSIX, grep is. The point is whatever you find in POSIX version of the manual, you may be almost sure it's supported almost everywhere (note: Linuxes may not be formally fully POSIX-compliant, but still).

Also note some commands don't have their own man page. Compare this answer.

1

You are on a learning curve that can be really frustrating. There is no how to guide that will cover all examples. This is basically some encouragement to keep on plugging at it.

What you'll learn is that there is a pattern to how commands are structured.

Things to look for are command --help is your friend. Read the information provided and consider what your trying to accomplish. It can be daunting at first but given a few weeks of trial and error you'll pick it up quickly.

Don't give up.

Hogstrom
  • 1,587