linux echo add new line to file code example Example: echo new line to file echo $'username=user\npassword=pass' > ~/samba-credentials