<commit_before>---
title: "Navigating and Editing the Command Line – Bash Edition"
layout: post
date: 2018-12-30 21:01
image: '/assets/images/posts-images/laptop.jpg'
description:
tag:
- command line
- bash
- field notes
- english
category: blog
star: false
author: rustam.mehmandarov
---
---

_A cheat sheet for moving around and editing your command line – Bash Edition._

- [Moving Around the Command Line](#moving-around-the-command-line)
- [Editing Commands in the Command Line](#editing-commands-in-the-command-line)
- [Bonus](#bonus)

---

Using the command line can simplify and even automate many of the operations we do on a computer. However, using the command line can mean quite a bit of typing and a possibly large number of parameters. In this post, I would like to focus on how to navigate the cursor and edit the command line, while leaving all the other Bash tricks for the future posts.

I also have created simple graphics to illustrate some of the main shortcuts listed below. This (hi-res) image can be printed for future reference.

![Navigating and Editing the Command Line (Bash Edition)] [1]
<figcaption class = "caption"> Navigating and Editing the Command Line (Bash Edition)</figcaption>


---

## Moving Around the Command Line

So, let's first speak about how to move the cursor around – because using just arrow keys is often not the most optimal way of navigating. Sometimes you might want to go to the beginning of the line, to the end of the line, or simply jump from one _word_ to another, where _word_ – in this context – is set of characters separated by spaces (or sometimes other special characters), or as [documentation][2] states it: 

> A sequence of characters considered as a single unit by the shell. Also known as a token.
<commit_msg>Minor fix<commit_after>---
title: "Navigating and Editing the Command Line – Bash Edition"
layout: post
date: 2018-12-30 21:01
image: '/assets/images/posts-images/laptop.jpg'
description:
tag:
- command line
- bash
- field notes
- english
category: blog
star: false
author: rustam.mehmandarov
---

_A cheat sheet for moving around and editing your command line – Bash Edition._

- [Moving Around the Command Line](#moving-around-the-command-line)
- [Editing Commands in the Command Line](#editing-commands-in-the-command-line)
- [Bonus](#bonus)

---

Using the command line can simplify and even automate many of the operations we do on a computer. However, using the command line can mean quite a bit of typing and a possibly large number of parameters. In this post, I would like to focus on how to navigate the cursor and edit the command line, while leaving all the other Bash tricks for the future posts.

I also have created simple graphics to illustrate some of the main shortcuts listed below. This (hi-res) image can be printed for future reference.

![Navigating and Editing the Command Line (Bash Edition)] [1]
<figcaption class = "caption"> Navigating and Editing the Command Line (Bash Edition)</figcaption>


---

## Moving Around the Command Line

So, let's first speak about how to move the cursor around – because using just arrow keys is often not the most optimal way of navigating. Sometimes you might want to go to the beginning of the line, to the end of the line, or simply jump from one _word_ to another, where _word_ – in this context – is set of characters separated by spaces (or sometimes other special characters), or as [documentation][2] states it: 

> A sequence of characters considered as a single unit by the shell. Also known as a token.

{'fraction_non_alphanumeric': 0.06942102304665543, 'fraction_numerical': 0.007869589657110737, 'mean_word_length': 4.188046647230321, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1372836', 'n_tokens_mistral': 985, 'n_tokens_neox': 922, 'n_words': 535}