Thursday, February 6, 2014

Cat!

     Wow it has been a while... It's going to be a fairly short update too. I plan on doing this one more often now that things have calmed down just a tad but, for now I will share with you the thing I most recently learned!

CAT!

     Cat is an interesting item for sure! If you just use it as it is... [cat file.txt] will show you the contents of the text file in your CLI. Or if you wanted to, you could cat those contents into a different file. So let's say that you were writing a code, and you needed the output of a file put into a variable or something, you could do it with cat. You can also do that just in your everyday if you wanted to make a HUGE text file from 37 different text files. You would just say [cat file.txt > big_text.txt] and then it would take the contents of file.txt and put it into big_text.txt. Handy! Then you just do that 37 times and you are set!

     But wait, there's more! You can even shorten that! I believe you could do that with something like this [cat file.txt file2.txt ..insert others here.. file37.txt > big_text.txt]. That's not super handy for something like 9,392 files but.... For a few it sure is! I think you could also make a clean folder and copy all of your text files to the folder and ONLY have the text files you want in there and simply do [cat *.txt > big_text.txt] and you would catch all and then put them into the big_text file! So handy!

     Another useful implementation of this process is for "part" iso files... Let's say you get something.iso_part1 and then something.iso_part2... Well that's just silly! Who would do that? People that can't host large files. The WORST kind of people... That's ok. We can solve this problem without giving them an earful. It's relatively easy also! Basically... You take the first file, second file, and then output it to 'complete.iso' and it will do it! As an example [cat /path/to/first.iso_part1 /path/to/second.iso_part2 > completed.iso]... Then you should have a combined file that is the complete iso! How handy is that! "Very" is the answer you were looking for.

     And that is a very useful thing that you can do with the [cat] command. It might not be something you use every day but it can definitely save you from copying and pasting 2,000 times.