Skip to main content

cat

write to file with CAT

end with EOF to close

cat << EOF > ./user.txt
root
jimmy
joanna
EOF
note

The cat << EOF > ./user.txt command will write to the user.txt file and EOF will be the end of file instruction to close file.

Or

cat >> ./user.txt
Enter some
date here
to the file
note

The cat >> ./user.txt command will write to the file and end the file with ctrl+d