CT320: Network and System Administration

Fall 2018

Plain Text

Plain Text

$ echo "abcd" >foo
$ echo "fg" >>foo
$ ls -l foo
-rw------- 1 ct320 class 8 Mar 28 12:45 foo
$ cat foo
abcd
fg
$ od -t x1 foo
0000000 61 62 63 64 0a 66 67 0a
0000010

Windows Text Files

What Plain Text is Not

Examples

$ date >good
$ cat good
Thu Mar 28 12:45:29 MDT 2024
$ ls -l good
-rw------- 1 ct320 class 29 Mar 28 12:45 good
$ file good
good: ASCII text

$ file /usr/share/cups/data/default.pdf
/usr/share/cups/data/default.pdf: PDF document, version 1.5

$ echo -n "hi" >bad
$ cat bad
hi$ ls -l bad
-rw------- 1 ct320 class 2 Mar 28 12:45 bad
$ file bad
bad: ASCII text, with no line terminators

$ sed 's/$/\r/' <good >bad
$ cat bad
Thu Mar 28 12:45:29 MDT 2024

$ ls -l  bad good
-rw------- 1 ct320 class 30 Mar 28 12:45 bad
-rw------- 1 ct320 class 29 Mar 28 12:45 good
$ od -t x1 bad
0000000 54 68 75 20 4d 61 72 20 32 38 20 31 32 3a 34 35
0000020 3a 32 39 20 4d 44 54 20 32 30 32 34 0d 0a
0000036
$ od -t x1 good
0000000 54 68 75 20 4d 61 72 20 32 38 20 31 32 3a 34 35
0000020 3a 32 39 20 4d 44 54 20 32 30 32 34 0a
0000035
$ file bad
bad: ASCII text, with CRLF line terminators

Linux Text Editors

There are many text editors on Linux:

Where’s the GUI?

User: Guest

Check: HTML CSS
Edit History Source

Modified: 2017-08-15T16:05

Apply to CSU | Contact CSU | Disclaimer | Equal Opportunity
Colorado State University, Fort Collins, CO 80523 USA
© 2018 Colorado State University
CS Building