?
Solved

how to use cat command

Posted on 2012-09-16
4
Medium Priority
?
616 Views
Last Modified: 2012-09-16
How do I use cat command

when I type man cat it says concatenate files and print on the standard output.

Does this mean if I have 2 seperate txt files, and excute with cat does this files join togethere and prints out.
0
Comment
Question by:bt1942
  • 2
4 Comments
 
LVL 85

Accepted Solution

by:
ozo earned 2000 total points
ID: 38402848
cat file1.txt file2.txt
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 38402854
cat writes the contents of the files whose names are given on the command line to standard output! one after the other.

So if file 1 contains

1
2
3

and file2 contains

3
4
5

cat file1 file2

Will write

1
2
3
4
5
6

cat file1 file2 > file3

will create a file with the above content.
0
 
LVL 38

Expert Comment

by:Gerwin Jansen, EE MVE
ID: 38403785
1
2
3
3
4
5

:)
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 38403793
Smartphone!  :-(
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question