Press "Enter" to skip to content

How to Type a Long Command in Multiple Lines in Linux/Unix

You can type a long command in multiple lines in Linux/Unix shell by using backslash (). Suppose you have a long command to type in a small screen area then you can split that long command over multiple lines in Linux or Unix shell.
The following is the example to split long command in multiple lines in bash shell:
$ /usr/foxhome/oracle/product/10.2.1/db_2/bin/rman
> target /
> catalog rman/[email protected]
> cmdfile=/home/oracle1/scripts/rmanchk.rmn
> msglog=/home/oracle1/rmanlog/rmanlog01.log append
As you can see in above command that backslash is used to split the line followed by Enter key or Return key and when you press the enter key the line will be preceded by the > character, this shows that the command extended to the next line.
Linux/Unix command examples

Vinish Kapoor

FoxInfotech.in is created, written, and maintained by Vinish Kapoor. It is built on WordPress, and hosted by Bluehost. Connect with Vinish on Facebook, Twitter, and GitHub.

You may also like: