ECHO NEXT LINE IN LINUX BASH

You want to copy some text or numbers but there should be one number or string per line. How would you do that? Use printf to easily redirect text or number with next line to a file

[root@orcl oracle]# printf "1\n2\n3\n4\n5\n6" > numbers

cat the output file

[root@orcl oracle]# cat numbers
1
2
3
4
5
6

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s