Various Flags in Bash

I see many times flags such as if [-n ${Parameter}] or echo -n <string>. Sometimes, I have seen flags like -r and others used. However, I don't know how to search for the meaning of these flags on web. Could someone send me some link where I can understand as to what they mean or some general note as to how should I search for them on google? Thanks!

3

1 Answer

You can of course check the doc on internet

Or if you have access to a linux or mac machine, just check out the installed doc !

Try man if for example.

Also, man could have multiple pages for the same query, for example man open will show the manual of openvt on my machine and is a command line executable. But writting man 2 open gives you the manual of the C open function. So by default man gives you manual of bash/command line and then C function. So man open could be written man 1 open

This is really useful if you don't have an internet access or if the version of the tools that you want to use is different from the "normal" one. I think about sed for example, that is different from linux and mac. So they has different manual.

Of course there is a man of man ... :) man man

I forgot to talk about help, most (and decent) program has the -h or/and --help. Most of the time the manual page shows much more information.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest