Sunday, June 7, 2015

Cat command usage

Hi,

Here I will show you how to use cat command in some of the areas to utilize from command line (CLI).

1) If you want to display the content of a file in the terminal, then use as below.

Syntax : $>cat <filename>

$> cat samplefile.text
Hello how are you

2) If you want to create a new file with some text in it.

Syntax: $> cat > new-filename

$>cat > hellofile.text
Hi hello how are you

To save the file, use Ctrl+c

3) If you want to append some text to an already existing file.

$> cat >> oldfilename.text
Hi this is last line

To save the file/ append the text, use Ctrl+c

To be continued.....

No comments:

Post a Comment