Friday, May 3, 2024
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 1525  / 2 Years ago, mon, november 29, 2021, 11:47:14

Does a Linux command set with descriptions exist on the net?



I have a list of commands I obtained by using alt! with 1947 commands listed. I put these into a file, but I am having to write what each command does by using the whatis command and then copying the result next to the command into the text document.



Is there an easier way to generate this list?


More From » command-line

 Answers
2

If your purpose is to have a document listing the whatis output for every system command on your machine, do:



find {,/usr}/{,s}bin -printf '%f0' | xargs -0 whatis > command-encyclopedia.txt



  • To also capture the entries for which there is no whatis output, append 2>&1 to that command

  • To put the undocumented entries in their own document, append 2> dark-commands.txt instead



Actually, to be a proper encyclopedia, you'll want to have it sorted as well!



find {,/usr}/{,s}bin -printf '%f0' | xargs -0 whatis | sort > command-encyclopedia.txt


Better yet, make it interactively searchable (thx for the suggestion @Doogfar!):



find {,/usr}/{,s}bin -printf '%f0' | xargs -0 whatis | sort | less


Now use / to search forward and ? to search backward, or Ctrl+F/B to page forward and backward in your encyclopedia.



Tip: if you want to save yourself the typing every time you need your command encyclopedia, put it in a shell function as described in this answer.


[#32264] Tuesday, November 30, 2021, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
epypian

Total Points: 130
Total Questions: 111
Total Answers: 113

Location: Romania
Member since Mon, Jun 6, 2022
2 Years ago
epypian questions
Sat, Jul 31, 21, 18:35, 3 Years ago
Sun, Oct 24, 21, 23:28, 3 Years ago
Sun, Dec 26, 21, 12:08, 2 Years ago
Tue, May 9, 23, 21:23, 1 Year ago
;