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

Hi, I am a full stack developer and writing about development. I document everything I learn and help thousands of people. foxinfotech.in is created, written, and maintained by me; it is built on WordPress, and hosted by Bluehost. Connect with me on Facebook, Twitter, GitHub, and get notifications for new posts.

Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *