Find the answer to your Linux question:
Results 1 to 7 of 7
What does the command cat do? The manual (man cat) uses the word 'concatenate' and describes it as a command that concatenate files but I honestly didn't understand a word...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie daacosta's Avatar
    Join Date
    Sep 2005
    Location
    Medellín, Colombia
    Posts
    213

    In plain English please...


    What does the command cat do?

    The manual (man cat) uses the word 'concatenate' and describes it as a command that concatenate files but I honestly didn't understand a word
    -D-

    Registered User # 402675

  2. #2
    Linux Newbie
    Join Date
    Jun 2005
    Posts
    123
    If you look up the word "concatenate" on either Dictionary.com or define: you'll easily find what it does.

    It basically takes 'n' number of documents and merges them into one, then lists them. n can be 1.

    It has other rarely used features.

  3. #3
    Linux User Game master pro's Avatar
    Join Date
    Sep 2005
    Location
    Tasmania, australia
    Posts
    274
    i use the cat command to view text documents

  4. #4
    Linux Guru fingal's Avatar
    Join Date
    Jul 2003
    Location
    Birmingham - UK
    Posts
    1,539
    Just like the fella above said, cat can be used to view text files. Here's an example. You are about to compile a package called, zippolibrary from source. You download the files, unpack them and - in a terminal - navigate to the correct directory.

    You see some text files in there. One is called INSTALL the other is README.

    You type cat INSTALL
    You type cat README

    You feel much better and really well informed.

    You could achieve similar results with the less or more commands.

    less INSTALL
    more README

    I am always doing that which I can not do, in order that I may learn how to do it. - Pablo Picasso

  5. #5
    Linux Engineer
    Join Date
    Mar 2005
    Posts
    1,431
    Also cat can be used to check if your mouse works correctly; cat /dev/input/mice

    I usually use cat on small text files (the big ones are for "less") or in scripts which should print/process a given text file.

  6. #6
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    I'd like to go into usage a little bit.

    cat's best known purpose is, of course, printing out a file to the terminal:
    Code:
    cat ~/.bashrc
    However, it is also capable of putting two files together in one (concattenating them):
    Code:
    cat test1 test2 > test
    This puts test1 and test2 together into a file called 'test'.

  7. #7
    Linux Newbie daacosta's Avatar
    Join Date
    Sep 2005
    Location
    Medellín, Colombia
    Posts
    213
    Interesting... From what I was reading in the book "How Linux works" I thought that this command was inocent but after seeing the thread...
    -D-

    Registered User # 402675

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •