Linux

Basic Linux Commands : Tail, Cat, Fold & Man

Hello There! Welcome to my first tutorial! Please do comment, I really do enjoy reading them 🙂
So Lets Begin…

Cat

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 cat [filename].[extension]

cat command linux

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.

Tail

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 og 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 tail [filename].[extension]

taild command linux

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]

tail command use

Fold

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]

fold linux command

Kinda cool? Ain’t it? Remember You can always save the output by typing fold -w[Number] [filename].[extension] > output.txt

Man

Did you the hole 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.

man linux command

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.

This article was submitted by Aayush Agarwal. If you want to submit an article contact any of the admins.

Also Read: Basic Linux Terms For Beginners


Add Comment

Click here to post a comment

Subscribe Now

Subscribe for free and get latest articles delivered right into your inbox.

Thank you for subscribing.

Something went wrong.

Categories

>-----ADVERTISEMENT-----<