Working with Commands

By now, you’re already pretty comfortable running commands in your shell. You’ve redirected program output, and you’ve used the command history to recall previous commands. But you can also chain commands together, execute them in different environments, and much more.

Running Multiline Commands

As soon as you press the Enter key, the shell executes the command. Some commands have a lot of options or are just very long and might not fit on your screen, and you’d like to be able to break the command into multiple lines. You can do this by typing the \ character before pressing Enter.

In Creating Pipelines of Data, you saw this example which lets you see the most-used commands in your history:

 $ ​​history​​ ​​|​​ ​​awk ...

Get Small, Sharp Software Tools now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.