0
votes
1answer
15 views

cd into first/second/third directory returned by ls -d */

Say I am in a directory code: /code /very-long-and-descriptive-name If I want to cd into that directory (or a directory if it comes first in alphabetical order), I can just cd *. Now say I add ...
2
votes
2answers
63 views

How do you get to editor in vi mode in bash

In emacs mode in bash (set -o emacs), I can get to the editor by typing ctrl + X, ctrl + E. But I have set -o vi on, which is vi mode, and this key sequence doesn't seem to trigger the editor in vi ...
1
vote
2answers
71 views

Keystroke to clear the current line at the prompt

How can the current line be cleared? I'm using bash. I don't like ctrl+c because it leaves crap printed on the screen. If the cursor is at the end of the line I can use ctrl+u and it does ...
1
vote
3answers
371 views

Delete last word (Ctrl-W): Make bash shell behave like vim command line

Among the many useful keyboard shortcuts available in the bash shell, there is Ctrl-W to delete the word to the left of the cursor. Let's suppose my command line looks like the following: cp ...
3
votes
1answer
334 views

Equivalent of bash's Ctrl-r in PowerShell

does anybody knows of a way to have the backward command search feature of bash [Ctrl-r] (and [Ctrl-o]) that are so useful, in windows powershell ? C-r is a more powerful arrow up history ...
2
votes
1answer
121 views

How can I attach a cygwin script to a keystroke?

I have a script that needs be launch through Cygwin with the following execution /usr/bin/bash -lic "/home/userdude/scripts/scrypty.sh param1 param2" How would I go about setting up a keyboard ...
1
vote
2answers
98 views

What is the command line shortcut to comment out the current line

I am looking for the command line shortcut to comment out the current line in the terminal. For example, I might enter git commit -am "a comm and then realize I don't actually want to commit yet. I'd ...
4
votes
1answer
293 views

readline / bash: How to map Escape key and Arrow keys?

From another piece of command-line driven software, I'm used to the following behavior: Arrow up / down go through the command history, matching lines that match the characters typed so far on the ...
0
votes
1answer
41 views

iTerm2 not respecting my key bindings…sometimes

I have my iTerm2 keybindings set to have command+left arrow and command+right arrow move the cursor to the beginning and end of the line. This works most of the time. But not when I am in ghci (the ...
4
votes
1answer
182 views

How can you reverse the direction of alt-period in Bash?

In Bash, you can press Alt-. to insert the last argument of the previous command. If you press it multiple times, it cycles through the last arguments of all of the commands in your history. However, ...
2
votes
2answers
1k views

bash home/end/delete key inserting tilde, or if preceded by escape key, [1~ [3~

bash home/end/delete key inserting tilde, or if preceded by escape key, [1~ say I type echo hellp, move cursor to hel|lp and type delete, and bam, i got ~tilde say I type echo hellp, move cursor to ...
1
vote
1answer
334 views

Can't assign a keyboard shortcut to a certain bash commands using xfce-keyboard-settings in Linux Mint

Can't assign a keyboard shortcut to certain bash commands using xfce-keyboard-settings in Linux Mint I'm using Linux Mint 14 Nadia I use xfce-keyboard-settings to assign keyboard shortcuts to ...
1
vote
2answers
179 views

Move left by a word instead of by a character in terminal

I want to move left and right by words using ctrl + left/right arrow in terminal (I'm on ubuntu 12.10). Currently when I use these keystrokes I get ;5D or ;5C appended onto the line, which is useless ...
1
vote
2answers
787 views

Debian wheezy keyboard shortcut for both opening and closing a terminal

I recently installed tilda and I would like to open it and close with the same keyboard shortcut. I wrote little something in bash that closes tilda if it is open and opens tilda when there is no such ...
1
vote
1answer
719 views

How to bind up arrow in ~/.inputrc (readline) for vim insert mode?

When in Readline apps with vim mode enabled in ~/.inputrc (set editing-mode vi) is there a way to bind the <Up> arrow key in vi-insert mode? To display previous history item, for example. It ...
2
votes
1answer
89 views

ATL + '.' like shortcut to get previous command parameter

I use ALT. very frequently on bash. But some time I go one past the parameter I want . So I was looking for a way to call the next parameter from the history.
2
votes
2answers
533 views

How to override default bash key-bindings?

I write this config file: # ~/.inputrc Control-d: "\C-udate +'%F %T'\C-m" I want to run date command when I type Ctrl-d. But I cannot override the default behavior(exit). Thanks for your help.
91
votes
4answers
36k views

Why does Ctrl + V not paste in Bash (Linux shell)?

When I copy something to the clipboard and press Ctrl + V in Bash, nothing happens; However, right clicking and selecting Paste does the job. Why? Is there any reasonable issue (I'm sure there is) ...
9
votes
3answers
4k views

How can I do Ctrl-Z and bg in one keypress to make process continue in background?

So I realized I follow this pattern of suspending the task and then letting it to continue too often with the Ctrl-Z bg sequence, I was wondering is there any way to compress that to single keypress? ...
1
vote
1answer
316 views

Bind CTRL+W to werase (default bash behaviour in Linux/PuTTY) in iTerm2

I use a Mac at home and have changed my modifier keys swapping Command and CTRL, so CTRL+T spawns a new tab in chrome, CTRL+C is copy and so forth. I use Windows/Linux at work and I want a consistent ...
2
votes
3answers
285 views

How to suspend bash within bash

Is it possible to suspend a bash that was invoked by another bash? For example, if I use su to become a different user but want to switch back to my own user for a moment. For another example, in an ...
0
votes
1answer
212 views

Which emacs shortcuts are useful in bash? [closed]

Other than Ctrl+{k, u, a, e}, what other emacs shortcuts are worth remembering and useful in the Terminal?
3
votes
3answers
1k views

Ctrl + A doesn't work in Bash Terminal on OS X Lion

In bash windows using the Terminal.app on OS X Lion, I can no longer use ctrl + A as a shortcut for going to the start of the command line. Other ctrl characters like ctrl + E don't work any longer ...
3
votes
1answer
1k views

Easy way to swap characters in command line with emacs key bindings?

If I'm in vi, and I see that I've transposed two characters, it is easily fixed by putting the cursor over the first and typing x followed by p in command mode. Is there a similar trick that works at ...
2
votes
3answers
1k views

how to scroll through text with the Git Bash shell with the keyboard

I am using Git bash on windows 7. Sometimes, when I am in a folder with a lot of files and when I type $ ls the shell displays more than one screen's worth of contents. In order to look at the ...
8
votes
3answers
4k views

Equivalent to ^D (in bash) for cmd.exe?

Is there an equivalent key-stroke for exiting a command prompt on Windows (launched via Start->Run : cmd) to the bash standby of Ctrl-d to prevent needing to type exit to leave the shell?
9
votes
1answer
323 views

What is Alt+Shift+{?

Tested this on CentOS and Ubuntu, if you're in a directory with a ton of files $ ls day1.tar.gz day2.tar.gz day3.tar.gz day4.tar.gz day5.tar.gz day6.tar.gz day7.tar.gz day8.tar.gz day9.tar.gz ...
3
votes
2answers
706 views

How can I create keyboard shortcuts to run commands in a terminal?

I was wondering is it possible to bind say F5 to output sudo apt-get update so I can press one key to write this into the terminal?
2
votes
4answers
992 views

Keyboard shortcuts in Bash shell [closed]

I know some useful Bash shell shortcuts, and I am wondering if there are others. The ones I know: CTRL + W: delete until beginning of word CTRL + U: delete until beginning of line Up / Down: ...
2
votes
2answers
186 views

How do I keep OSX from catching/interpreting the bash keyboard-shortcuts?

When I open a bash terminal in OSX and then type Alt + F to got back one word it instead opens the find dialog? Many of the other key-bindings have similar problems. How can I change this?
2
votes
1answer
624 views

Map reverse-history-search function in bash to a shortcut other than CTRL+R

I'm using Putty Connection Manager which captures CTRL-R key before it can get to my bash shell. So I was wondering if it is possible to map the reverse-history-search to another shortcut key. Such ...
3
votes
1answer
183 views

Delete until previous punctuation mark in Bash

In Bash, Ctrl + W will erase the last word. Bash considers words to be delimited by spaces. This means that if the cursor is at the end of the string "cd /dir1/dir2/dir3" and you hit Ctrl + W you ...
28
votes
5answers
38k views

Mac OS X keyboard shortcuts for terminal

After googling for some Mac OS X terminal shortcuts, I wanted to find how can I go back characters on a line on the terminal or words or similar. I found ALT + B but it does not work. Do you know ...
6
votes
6answers
1k views

What are the common Control combinations in a terminal setting

I would like to have a good guide to the common Control key combinations in use in bash (and similar) shells and the combinations used by common programs in use in those shells. My particular ...
10
votes
1answer
9k views

How to go back or forward a word in bash environment? [duplicate]

Possible Duplicate: How can I move around the bash commandline efficiently? In the Windows prompt, one can go back or forward one word by pressing ctrl and <-/->. What's the ...
12
votes
6answers
4k views

How can I move around the bash commandline efficiently?

So I use the up in my shell (Bash on OSX or Ubuntu, mostly) but some of the time I know that I want the stuff after the cursor's current location. Is there any way to have the line I'm on complete ...
10
votes
3answers
11k views

How to do Page-Up on a Mac in Terminal

The laptop has no page-up/down buttons. How can I have page-up/down on the terminal, e.g. when I edit with vi?