Hello There! Welcome to my first tutorial! Please do comment, I really do enjoy reading them 🙂
So Lets Begin…
Oh, come on I know cat! Its an animal! Yes, it is. But its a command too. Lets suppose you wanna make a view a file real quick, you dont’t have to open your favourite text-editor. You can use
Okay so cat command is used to view files, easy. Well, what you know, you can even make files or even put some text in it. Use
cat > [filename].[extension] When you are done writing, hit enter and then press Ctrl+C to exit.
A very useful command to view change logs or real time data. This command prints the last 10 lines(Can be changed to more) of a file. How is it useful for me? Imagine that you wanna view a changel log or log file which always get changed from its very bottom and its top always remains the same. Why to open up the hole file and scroll to its very end to view what you actually need? Just use
Out of all those commands I have used in the past, I am only viewing the last 10 commands I’ve used most recently. If you wanna increase the the output to more then 10 lines, use
tail [filename].[extension] -n [NumberOfLines]
headcan be used to view top of the file.
Another, yet useful command to organize a writeup, essay or story. Choose how many characters or the max-width you want in each line and it will help you to do that in no time. Seriously, like how much have you wasted organizing your stuff? Anyway so here is my story:
Messed up, ain’t it? Lets organize it! Use
fold -w[Number] [filename].[extension]
Kinda cool? Ain’t it? Remember You can always save the output by typing
fold -w[Number] [filename].[extension] > output.txt
Did you the whole time you were wondering how to use a command or its syntax, you were just wasting time? Man is command which can give you detailed information about a command and its syntax. And its actually straight forward to use, you just type
man [CommandYouWantToKnowAbout]and boom! lots of info would be popping out of your screen. Here is the man page of an above mentioned command, Tail.
So that’s all I’ve got time for today. Hope you enjoyed it as mush as I did making this tutorial for you guys.
Also Read: Basic Linux Terms For Beginners