Home > Articles

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Long Command Lines

Long command lines are automatically scrolled by Bash: When your cursor reaches the right-hand side of the window, Bash continues the command on the next line.

If you want to break up a command so that it fits on more than one line, use a backslash (\) as the last character on the line. Bash will print the continuation prompt, usually a >, to indicate that this is a continuation of the previous line.

$ printf "%s\n" "This is a very long printf. How long is it?\
> It's so long that I continued it on the next line."
This is a very long printf. How long is it? It's so long that I continued it on
the next line.
  • + Share This
  • 🔖 Save To Your Account