JZ.
JZ.

Reputation: 21877

Is there a way to get to the beginning of a command without holding the arrow?

I've been using unix for some time, and I would like to know if there is a simple command for getting to the begginging of a command without holding the arrow.

Say I want to change /usr/ to /foo/

/usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

Upvotes: 1

Views: 42

Answers (2)

SiegeX
SiegeX

Reputation: 140327

After you typed the first command you could use

$^/usr/^/foo/

To run the last command by replacing /usr/ with /foo/

Example

$ echo "/foo/bar/"
/foo/bar/
$ ^/foo/^/baz/
echo "/baz/bar/"
/baz/bar/

Upvotes: 3

Niklas B.
Niklas B.

Reputation: 95308

Emacs bindings: Ctrl+A or Home

VIM bindings: 0

Upvotes: 1

Related Questions