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