Questions and Answers about k shell(ksh)

星期四, 十一月 23, 2006

Questions and Answers about k shell(ksh)

At first, I think ksh is very hard to use than bash. While after sometime, I know we can make it more powerful by this way.
Note: please type set -o vi first, if you never call this command in ksh. you will feel of convenience of ksh.

Q: How to complete thefile path name automatically?
A: Press ESC and '\' in sequence at the begin characters of the path

Q: How to call history command quickly?
A: Press ESC and 'i' in sequence, you can get the previous command you type. Press 'i' again will move backward in histroy commands. Press 'j' will move forward in histroy command.
Press '/' will search in histroy command to find one that match the string after '/'.

Q: How to move cursor in command line?
A: Press ESC first, then press key below to move cursro:
'0' - line begin
'$' - line end
'b' - backward a word
'w' - forward a word

Q: How to edit the command you typed?
A: Press ESC first, then move the cursor to postion that you want to edit. then you can press the commands in vi command mode to edit the line.


Note: you can also use set -o vi in other shells, such as bash. By the help of this, you can enhence the bash that you can search history command quickly.

0 Comments:

发表评论

Links to this post:

创建链接

<< Home