productivity issue - unix shell

Posted on 2000-03-15
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
Question by:crest
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
LVL 40

Expert Comment

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

Author Comment

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

Expert Comment

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.
Independent Software Vendors: 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

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
LVL 40

Accepted Solution

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.


Author Comment

ID: 2644650
it works very well

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AIX Server 10 91
unix solaris snoop command 6 122
Shell Script on AIX 7 146
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
FreeBSD on EC2 FreeBSD ( is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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…

749 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