Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
22
rated 0 times [  22] [ 0]  / answers: 1 / hits: 2826  / 1 Year ago, fri, december 30, 2022, 12:54:58

When I press tab in a console I get this output




Display all 2957 possibilities? (y or n)




Is there any way to use grep on these 2957 possibilities? I would like to search for all commands with the word "svn" in them.


More From » bash

 Answers
7

The solution is the bash builtin compgen. To grep 'svn' from all available commands and command aliases accessible through $PATH, type.



compgen -ac | grep svn


Want to search from a certain prefix (eg all commands that start with ecrypt)? Use regular expressions..



compgen -ac | grep "^ecrypt"

[#41155] Friday, December 30, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
barted

Total Points: 424
Total Questions: 103
Total Answers: 101

Location: Djibouti
Member since Sun, Feb 27, 2022
2 Years ago
;