Solved

productivity issue - unix shell

Posted on 2000-03-15
6
283 Views
Last Modified: 2010-04-21
when typing commands in a unix shell e.g. tcsh, it is possible to go to the beginning by pressing Ctrl and 'a' at the same time.  Similarly, Ctrl and 'e' goes to the end of the line.  My question is: is it possible to go by word?  just like Ctrl and left arrow get me to the previous word.

thx in advance
0
Comment
Question by:crest
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 2623433
esc-f & esc-b should move forward & backward by words.
0
 

Author Comment

by:crest
ID: 2628380
that works!!
just wondering if there is any way you can assign esc-b to Ctrl + <-?
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2628612
Yep, you can. From the tcsh man page:

"Command-line  input can be edited using key sequences much
like those used in GNU Emacs  or  vi(1).   The  editor  is
active  only when the edit shell variable is set, which it is by default in interactive shells.  The bindkey  builtin
can  display  and  change  key  bindings."

If that isn't enough info, I can create an account that uses tcsh (I always use bash and have since the first version of it) and walk you through setting a binding.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:crest
ID: 2633263
that sounds a little bit complicated.
it would be very nice of you if you can show me how to do that step by step
0
 
LVL 40

Accepted Solution

by:
jlevie earned 100 total points
ID: 2633835
If you execute "bindkey | more" you can see the key bindings. The binding of esc-f (forward-word) and esc-b (backward-word) are represented in the list as "^[f" and "^[b", "^[" being the ASCII representation of ctrl-[ which is the same code as the esc key generates. While you can't bind ctrl->/ctrl-< to anything as that combination doesn't generate a control code as far as tcsh is concerned, you can pick other keys to bind. For instance; "bindkey -b ^F forward-word" changes the binding of ctrl-F from forward-char to forward-word. The old binding of forward-char is lost, but it's also bound to the right arrow key so that's not a big loss. You could do a similar thing with "bindkey -b ^B backward-word"

For these bindings to persist across logins, you'll want to add the commands to your .tcshrc file.

0
 

Author Comment

by:crest
ID: 2644650
it works very well
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question