Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6803
  • Last Modified:

Command Line Beeping

Hey everyone -

I assume this is probably a pretty easy question to answer, as it is probably just setting a 1 to 0 in some file, but I can't find where.  My command line will let out this annyoing 'BEEP' everytime I do something wrong.  (Like try and continue to scroll after I have reached the bottom of a file in vi, or hitting TAB when there is more than one file to list, etc...)

Anyway, as this is a laptop, it is extremely annoying to have happen when I am somewhere like a restauraunt.  Is there a way to turn this beeping off?

~ace
0
Topace
Asked:
Topace
  • 6
  • 3
  • 2
  • +3
1 Solution
 
paullamhkgCommented:
will there any sound/volume control on your laptop? normal on the side of your laptop try to use the control to turn your laptop sound off or to the lowest.
0
 
TopaceAuthor Commented:
no all the sound control is in the os

~ace
0
 
paullamhkgCommented:
have a check here http://www.linuxgazette.com/issue47/ayers.html#ayers2 but it only for play music on command line, and you need to install software into your OS.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
GnsCommented:
As I understand this, you want to avoid an audible... This is a "properety" of your shell (the actual ringing of the terminal bell).
Assuming you are using bash, it isn't actually the shell that keep ringing your bell... rather it is the readline library (incorporated for things like eiting command history etc)... Perhaps the following snippet from the bash man-page would help:
----------------------------
       bell-style (audible)
              Controls  what  happens when readline wants to ring
              the terminal bell.  If set to none, readline  never
              rings the bell.  If set to visible, readline uses a
              visible bell if one is available.  If set to  aud­
              ble, readline attempts to ring the terminal's bell.
----------------------------
So add the following (or chage it if already there:-):
set bell-style none
in your $HOME/.inputrc, and those pesky beeps should go away;-).

-- Glenn
0
 
owensleftfootCommented:
Gns, the above will only work if he is in a virtual console. If he is running from a terminal in X he needs to put the line "xset b off" in one of his X startup files such as .xinitrc or .xsession.
0
 
owensleftfootCommented:
Gns, the above will only work if he is in a virtual console. If he is running from a terminal in X he needs to put the line "xset b off" in one of his X startup files such as .xinitrc or .xsession.
0
 
GnsCommented:
No. The xset setting will take precedence under X, but the readline setting will prevent bash (and anything else using readline) from even trying to ring the bell. So one might say its the other way around:-)... "xset b off" will only work for X, while "set bell-style none" will work anywhere:-):-).
Best solution would probably be a combination;).

-- Glenn
0
 
owensleftfootCommented:
I set "bell style none" but couldnt get the bloody thing to stop beeping under X until the "xset b off". Its a mystery :)
0
 
GnsCommented:
Yes... I do believe I've got this working... checking... Oh, I see a possibility... Did you remember to restart the shell (logout/login)? Just checked on a Mdk9.2, and both the .inputrc and xset things work as expected (ie: as I/the docs say:-).

-- Glenn
0
 
GnsCommented:
... and you (for the xset thing... not trying to usurp anything here:-).

-- Glenn
0
 
paulqnaCommented:
All you need is the escape sequences:

Per-console Beep Configuration

  As of Linux 1.3.43, Martin Mares added configurability to the bell
  sound in console.c. You can change the duration and pitch of the
  console beep on a per-console basis, by writing escape sequences to
  the tty. You can apply your configuration in your own ~/.profile or
  ~/.login, to have a different beep (or no beep) associated to each
  console.

  The escape sequences work as follow:

  ·  ESC-[10;xx] chooses the bell frequency in Hertz. The value should
     be in the range 21-32766, otherwise the result is undefined (at
     least up to the 2.0.x version -- I can't foresee the future.  If
     the `xx' argument is missing, the default value (750Hz) will apply,
     as in `ESC-[10].

  ·  ESC-[11;xx] chooses the bell duration, in milli-seconds.  If you
     specify more than 2 seconds, the default applies (125ms). Once
     again, if the `xx' argument is missing (ESC-[11]) the default value
     will be used.

  To print the escape sequences, you can try for example (50Hz, 1s)
  "echo -e "\33[10;50]\33[11;1000]"" with bash (where "-e" means
  `understand escape sequences'. With tcsh "echo
  " 33[10;50] 33[11;1000]" will have the same effect.

  Note that a new `setterm' command might support bell configuration of
  command line, as these control codes are marked as `setterm-commands'.
  However, no `setterm' version I know of supports these codes.

  If you run Linux-1.3.43 or newer, you may be satisfied with the escape
  sequences and avoid reading further. If you run an older kernel (I do
  it myself, on a small 386), or if you want the visual bell, have a
  good reading.
0
 
paulqnaCommented:
whoops forget that, misunderstood question completely...
0
 
GnsCommented:
;-)

-- Glenn
0
 
ajenkinsCommented:
echo 0 >/proc/sys/dev/speaker/beep
0
 
GnsCommented:
Clearly answered (no refund)... Possibly a split.

-- Glenn
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 6
  • 3
  • 2
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now