6

As a Unix beginner, I often find myself wanting to know the name of the command that achieves a particular function I'm after. How can I go about finding out the name of the command, given a description of what it does?

0

6 Answers 6

12

A good starting point, if you don't know the exact command name, is apropos. You'll find a short description here or with man apropos.

1
  • 1
    On my Ubuntu box, apropos ls returns 329 entries, which is much more then I expected. I found that apropos --exact ls gave me a more concise list (2 entries). Commented Oct 21, 2010 at 20:25
6

In addition to apropos (which can also be written man -k), a useful command is man -K key_word (capital K). This searches for a man page with the 'key_word' anywhere in the man page (man -k searches only in the short description part). Either way, the result are shown with the section between brackets:

[gojan@Gonux ~]$ man -K copy ... cp (1) - copy files and directories cp (1p) - copy files ... 

You can use this number to avoid ambiguity like:

[gojan@Gonux ~]$ man 1 cp CP(1) User Commands CP(1) NAME cp - copy files and directories ... [gojan@Gonux ~]$ man 1p cp CP(1P) POSIX Programmer's Manual CP(1P) PROLOG This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. 
3
  • man -k is a synonym of apropos. Commented Apr 4, 2011 at 19:27
  • Ups, you are right. I misspelling the '-k'. This is the correct command man -K. Thanks Commented Apr 5, 2011 at 14:32
  • +1 for discovering that apropos is man -k and discovering that man -K is a more powerful apropos (more powerful because it searches the entire command description). Commented Jun 7, 2011 at 20:34
3
man intro 

is the unix way of answering this question.

3

If you want to list all possible commands try hitting <Tab> twice

2
  • I don't want a list of every possible command that doesn't tell me squat about what they're for. Commented Oct 21, 2010 at 15:20
  • @Zaid , I'm sure that wasn't what you were looking for, but Ayush's question does give you a "List of *nix terminal commands", per the Subject. Commented Oct 21, 2010 at 20:27
1

You might want to print out or bookmark a cheat sheet. I like this one which is the first result on the Google search for "unix cheat sheet" for a reason.

1

To be honest, I find myself in the same situation that you are quite often. Even though I'm not a beginner.

But knowing which tool does what is, is something that will haunt you forever, especially, since new tools are coming in quite fast, are Distro dependent, and the UI changes sometimes from version to version (as with tar, that changed the meaning of the -J switch recently).

Here's what I'm doing:

  1. I use Fedora, which uses RPM for package management. Suppose I'm looking for a tool that helps me edit ID3-Tags. I'd just use: yum find ID3.
  2. In case I don't find what I'm looking for, I'd consult Wikipedia. It sounds lazy and strange, but it's really quite reliable: http://en.wikipedia.org/wiki/Tag_editor#List_of_tag_editors
  3. Now, when I know what I'm basically looking for, but can't find the tool that suits me or the functionality in question (i.e. details, or comparison), I'd ask around on IRC or even here.
1
  • +1 for the suggestion to use the system package manager's search function. Debianish distros like ubuntu, mint, etc. provide aptitude search ~d${regex} to search package descriptions. Also, googling linux TOPIC or e.g. ubuntu TOPIC is frequently enough to get a hint. Commented Apr 4, 2011 at 3:21

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.