1
0
mirror of https://github.com/jlevy/the-art-of-command-line.git synced 2024-12-12 10:45:00 +02:00

Ctrl-U + Ctrl-Y when you want to change command midway of tying it.

Previously, it was described here to use **ctrl-a** to go to the start of the line, enter a **#** and then press enter so that it will be a comment instead of a command. But AFAIK, the **ctrl-u** + **ctrl-y** method is more popular.
This commit is contained in:
Shubham Bhattar 2018-04-16 23:27:33 +05:30 committed by GitHub
parent 8ee5bfd705
commit 0138f8d033
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,7 +93,7 @@ Notes:
- To go back to the previous working directory: `cd -`.
- If you are halfway through typing a command but change your mind, hit **alt-#** to add a `#` at the beginning and enter it as a comment (or use **ctrl-a**, **#**, **enter**). You can then return to it later via command history.
- If you are halfway through typing a long command but you suddenly remember that you need to run another command before this command, hit **ctrl-u**. This will the cut the part from the beginning of the line to the cursor. This will stay in your clipboard and then you can paste it when required using **ctrl-y**.
- Use `xargs` (or `parallel`). It's very powerful. Note you can control how many items execute per line (`-L`) as well as parallelism (`-P`). If you're not sure if it'll do the right thing, use `xargs echo` first. Also, `-I{}` is handy. Examples:
```bash