by Ryan Irelan
In the command line, you’ll often find yourself wondering exactly what some command does, what the options are, and how, just maybe, you can make your use of that command even better. Here’s how to do it.
The first place I always look when needing more information about the command is the manual (or
man as the cool kids might refer to it). Most well-maintained and well-documented tools will have robust manual pages for you to review.
Let’s say we need to know more about git-reset, a tool in Git that allows you to (destructively) rollback changes to your repository.
I know the command is
git reset and if add the
--help option to it, I’ll get the manual for git-reset.
git reset --help
In the case of git-reset, we get a healthy amount of well-written documentation and very, very helpful Examples area. The examples provided offer real-world scenarios you might face, right from the folks who are working on the Git source code.
Another way to get help with a command is to use the
This will display the manual for the SSH command (note that
ssh --help does not work).
Not every tool has as robust a manual as Git and SSH but most all do, and you can learn a lot from them. Next time you get stuck, check out the manual!
Want to learn more about the command line? Our Command Line Fundamentals course will get you started on the path to success.