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.
Linux for Beginners doesn't make any assumptions about your background or knowledge of Linux. You need no prior knowledge to benefit from this book. You will be guided step by step using a logical and systematic approach. As new concepts, commands, or jargon are encountered they are explained in plain language, making it easy for anyone to understand.$ Check price
Relieve spasms, tight muscles, trigger points and pressure points with the Body Back Buddy! This trigger point massage is designed to help you self-message any area of your body - especially those that are hard to reach. Keeping your muscles relaxes and out of contraction is importan in helping to reduce pain and prevent muscle injury.$ Check price