Jump to content

bash terminal behaviour [solved]


Recommended Posts

I figured out that bash terminal shell behaves slightly differently in Ubuntu and Mandriva.

 

The biggest difference for me is when I type some thing like this:

$ ls fil

and then press TAB. In Mandriva, pressing TAB gives me a list of all files in this directory that start with fil:

file1 file2 file_to_delete

In ubuntu, I first hear a loud beep, and the list appears only when I press TAB for the second time.

 

The second big difference is that Ubuntu does not request me to confirm whether I want to remove a file, when I type

$ rm file

, ie it defaults to

$ rm -f file

. Mandriva gives you a chance to confirm deleting, I like this feature a lot.

 

Now my question is how I can make bash in Ubuntu follow Mandriva's settings. I have an Ubuntu PC in my office. Coming from Mandriva, I have a habit of pressing TAB very frequently, so the beep irritates everybody around. I don't want to disable speaker altogether - occasionally, the beep is useful. Also, it would be good to change the behavior of the rm command. I recall that there must be an alias somewhere but I cannot remember where it is.

 

Can anybody please help.

Edited by coverup
Link to comment
Share on other sites

Compare your .bashrc files of these two distros. bash shell has several items which are configurable.

For the record, in Archlinux ls behaves the Mandriva way, and rm the Ubuntu way. I do not really know which is the "vanilla" behaviour, but since it's user-configurable, I wouldn't bother that much...

Link to comment
Share on other sites

Thanks, scarecraw. This solves the problem of interactively deleting files. Indeed, Mandriva sets those commands as aliases in /etc/profile.d/alias.sh. If I could also find a solution to beeping :-)

I think I found a solution... According to this post,

http://machttp://macosx.com/forums/unix-x1...ion-bash-2.html

it is necessary to put

set show-all-if-ambiguous on

in the file ~/.inputrc . I created this file, and the problem is solved.

Edited by coverup
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...