Tuesday, February 5, 2013

Create/Append Text File Without Text Editor on Command Line


Create Text File Without Text Editor on Command Line

# Create file
$ cat > /tmp/temp_file_name.txt
some content
more content
and even more content
<Ctrl-D>
 
# View file content
$ cat /tmp/temp_file_name.txt
some content
more content
and even more content

Append to Temporary File Without Editor on Command Line

# Append to file
$ cat >> /tmp/temp_file_name.txt
append content
append more content
append even more content
<Ctrl-D>
 
# View file content
$ cat /tmp/temp_file_name.txt
some content
more content
and even more content
append content
append more content
append even more content

No comments: