Linux help

I just had a question as to where to find help in Ubuntu. While the man pages are there, they are sometimes so bad, I have no idea what they are trying to say. I realise these pages were written for eggheads, by eggheads, so maybe we can help ourselves a bit?

Open a terminal and let’s get busy. Try this on for size: help printf

You should see something like the above. Now go look at the man page for printf.

You may say, all good and well, but as they say in the adverts, wait, there’s more!

Try that same command with tack d, like so: help -d printf

Like so:

Right, you can see where I am going here, so I will not add screenshots of everything; if you are a n00b, I want you to actually do it to see the output change.

Now we know:

Option: -d

Display a short description for each topic.

Now I want you to repeat that with the -m instead of the -d.

You will notice that it looks a bit more like a man page. What do you think the -m is for? Yes!

Option: -m

Display usage in pseudo-manpage format.

You will agree that it is better than the manpage. If you are not sure, go look at the manpage again.

So if we wanted to see the syntax, what do you think we would use? Correct -s ! See you guys are really good at this. Suddenly the Linux command line is not so scary any more! So go ahead and try: help -s printf

Option: -s

Display a short usage synopsis for each topic.

The other thing I want to address in this CnC is echo. Yes, that thing you use to print something to the screen. I want you to try this:

It is just a quote from ‘Bridge to Tarabithia’, but you can type anything. Put as many spaces as you like between the words. See what you get. So if you have some horribly formatted text, you can use echo to straighten it out for you; neat, hey? Simply type echo, then copy and paste the badly formatted text in and press enter. There may also be the odd occasion where you need to actually push spaces to the screen. The way to do that is to encapsulate the text with quotes.

Obviously, if the text has no quotes, it does not matter which quotes you use, double or single. Usually one uses these quotes to insert escape characters. Quoted lines can include special escaped characters recognized by the echo command (when using echo -e).

Try: echo -e “ a new line\n here and also a \t tab”

You may not know all these escape characters, but now is a great time to give the help command a go as above. I suggest using all the options at your disposal to get used to them.

Those of you who actually did it before I suggested it, bravo! You will have this command line thing down in no time!

Just be aware that some commands are installed with external applications and may not have a help file or a man page. Here you usually need to try -h or –help as an alternative. My suggestion is to make sure of what you are installing, from say, github, by reading the new command’s documentation. Some of these may not even have any help built in, so it would be up to you to familiarise yourself with the command before you forget where you installed it from.

If the program you installed does not seem to respond to any of the usual channels, you can try the “Windows” way by using “/?” instead. Sometimes these things are written with Windows in mind and somehow find their way into the Linux ecosystem.

Remember that as per my answer in QnA, there is always F1. F1 from within a program, is usually help, though it will not help you on the command line.

OK, I hope I helped someone find help and gave one of you, at least, a handy tip to format text.

If you think there are errors here: misc@fullcirclemagazine.org