GagA// 0n D nEt

It is currently Sun May 20, 2018 3:43 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Linux: Utility to remember a command, if you don't remember
PostPosted: Sat Apr 25, 2009 8:47 pm 
Offline

Joined: Wed Jul 18, 2007 1:14 am
Posts: 181
What can I do if I don’t remember the name of a command I need?

The answer to this question is "apropos".

You can certainly go around looking all different combinations you remember and then using the tab key to auto complete, but that surely is going to take some time. Your friend in such situation is apropos.

apropos allows you to search a database of available commands, using keywords. So for example, you want to find a specific word and you don't remember the actual grep command to use, then you can use the following command:
Quote:
[email protected]:~$ apropos grep

The following is what you will be getting after using the above command.
Output:
Code:
EXIGREP (8) [exigrep] - Search Exim's main log
bzegrep (1)          - search possibly bzip2 compressed files for a regular expression
bzfgrep (1)          - search possibly bzip2 compressed files for a regular expression
bzgrep (1)           - search possibly bzip2 compressed files for a regular expression
egrep (1)            - print lines matching a pattern
exigrep (8)          - Search Exim's main log
exiqgrep (8)         - Search in the exim queue
fgrep (1)            - print lines matching a pattern
grep (1)             - print lines matching a pattern
pgrep (1)            - look up or signal processes based on name and other attributes
rgrep (1)            - print lines matching a pattern
zegrep (1)           - search possibly compressed files for a regular expression
zfgrep (1)           - search possibly compressed files for a regular expression
zgrep (1)            - search possibly compressed files for a regular expression
zipgrep (1)          - search files in a ZIP archive for lines matching a pattern

Note: The numbers in the brackets above indicate the section in the man pages where this information can be found. For example: man egrep to look at section 1 (the default) in the man pages for the egrep command or man 8 exigrep to go directly to section 8 to see the exigrep command.

It is possible that apropos won’t find every possible related command. For example, if you search for information on tape drives using: apropos tape, it would list a number of commands related to operating the tape drive, including mt and rmt, but it would not include tar, which can be used for tape backup. So you may need to be creative to find what you are looking for.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group