Learning about MORE FLAGS

In the last post we discussed how flags can change the behavior of a command. Now comes the big question: How do we know what flags a command has? We can’t use the flags if we don’t know what they are.

The first way to find what flags a command has is to ask the command for help. We can use the flags -h or –help. Many commands have one or both built in to give you a list of flags and a brief explanation of what each command does.

Unfortunately, not every command has this built in. Try ls -h and you’ll see.

So we need another way to find out the flags. This requires using another command called man. man, short for manual, describes the command and lists all possible flags. It also can include examples of using the command and pointers to similar commands. For example:

Alpha:~ computerlamp$ man ls

The results from this command are called man pages. The man pages can be really long in a lot of cases, luckily the results are put through the more command so you can page through and not try to read the resuts as it scrolls by. What happens if you try to read a man page that doesn’t exist? Try it!

Alpha:~ computerlamp$ man sith
No manual entry for sith

So according to the man pages, there are no sith… At least, this computer doesn’t know about sith.  I assume that means it doesn’t know about the force…

Alpha:~ computerlamp$ man force
No manual entry for force

Leave a Reply

Your email address will not be published. Required fields are marked *