LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-18-2021, 09:19 AM   #1
usr345
Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 208
Blog Entries: 1

Rep: Reputation: Disabled
Parameters hints and auto completion in bash


At work I have Ubuntu server with bash shell. I found out, that it can add tips and auto-completion for commands. For example:

Code:
$ git che<tab>
checkout      cherry        cherry-pick

$ git chec<tab> -> git checkout
On my Linux Slackware 14.2 there is no such feature. How does Ubuntu do it? Is it possible to enable it on another distro?
 
Old 10-18-2021, 10:15 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,677

Rep: Reputation: Disabled
Quote:
Originally Posted by usr345 View Post
How does Ubuntu do it?
Code:
$ dpkg -L git|grep completion
/etc/bash_completion.d
/etc/bash_completion.d/git-prompt
/usr/share/bash-completion
/usr/share/bash-completion/completions
/usr/share/bash-completion/completions/git
/usr/share/bash-completion/completions/gitk
AFAICS, the git 2.33.1 package in -current installs it, too. For git 2.17.6 in 14.2, you'll probably have to symlink /usr/doc/git-2.17.6/contrib/completion/git-completion.bash yourself.

I suppose you have bash-completion installed.

Last edited by shruggy; 10-18-2021 at 10:24 AM.
 
Old 10-19-2021, 03:40 PM   #3
usr345
Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 208

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by shruggy View Post
[code]$I suppose you have bash-completion installed.
I installed it. The directories "/usr/share/bash-completion/" and "/etc/bash_completion.d" did appear, but there are no completions for commands.
 
Old 10-19-2021, 04:18 PM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,677

Rep: Reputation: Disabled
As I said, the Bash completions for Git are in /usr/doc/git-2.17.6/contrib/completion/git-completion.bash. You'll have to symlink it yourself:
Code:
ln -s /usr/doc/git-2.17.6/contrib/completion/git-completion.bash /etc/bash_completion.d/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
edit a file /etc/fstab , what parameters can be changebale and which parameters lenin99 Debian 7 01-24-2017 04:03 AM
LXer: What's the files? Bash auto-completion to the rescue. LXer Syndicated Linux News 0 05-13-2016 06:15 AM
Bash auto-completion question PatrickNew Linux - General 3 05-02-2008 11:31 PM
auto-completion in bash with wildcards juanbobo Linux - Software 2 04-07-2005 12:56 AM
auto-completion - how does it work & can my script args auto-complete? BrianK Programming 1 06-11-2004 04:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration