Let's look at the
cat command (short for concatenation), which is used for manipulating text files.
There are a number of things cat can do including:
To display the contents of a file, simply place a filename or the path to a file as an argument.
$ cat fileName
file contents will output here.
cat is also used to create a text file. The following command will allow you to type directly into the terminal to the helloWorld.txt file.
$ cat > helloWorld.txt
type in text here.
To quit, press ctrl+d.
To place two or more text files together, simply use the following command:
$ cat file1.txt file2.txt > newFile.txt
To append instead of overwriting, use
>>. Appending will simply add to the end of a file instead of starting a new one.
$ cat >> helloWorld.txt # now type some text here and it will get appended to existing text.
ctrl+d to when done.
cat command has a few options which you may find useful.
This foam seat cushion relieves lowerback pain, numbness and pressure sores by promoting healthy weight distribution, posture and spine alignment. Furthermore, it reduces pressure on the tailbone and hip bones while sitting. Perfect for sitting on the computer desk for long periods of time.$ Check price
This book approaches system administration in a practical way and is an invaluable reference for both new administrators and experienced professionals. It details best practices for every facet of system administration, including storage management, network design and administration, email, web hosting, scripting, and much more.$ Check price