Quickly move the cursor to different parts of the command line based on a mark.

ctrl-x ctrl-x
Use 'ctrl-@' to set a mark. See the first comment for a better explanation.

2
By: somaddict
2012-11-16 03:49:26

What Others Think

A couple of points. First the readline command is "ctrl-x ctrl-x". If you don't use ctrl for the second one it doesn't work. Secondly, it doesn't necessarily move you to the beginning, or end. It moves you to the last 'mark', which if undefined is the beginning. The second time you use it, it will put the cursor back where it was (not necessarily the end). You can set the 'mark' by using 'ctrl-@'.
flatcap · 465 weeks and 6 days ago
somaddict · 462 weeks and 6 days ago
Thanks! I will update it. I found it randomly and did notice a bit later that it was based on a "mark" as you say. Thanks for the 'ctrl-@' tip.
somaddict · 462 weeks and 6 days ago
I would love to learn how to code and program so that I can take projects and save money for my dream pc! Yorba Linda Concrete Pros
MichaelRose · 8 weeks and 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: