command: cat

Discussion in 'Beginner Tutorials' started by Rob, Nov 3, 2011.

  1. Videodrome

    Videodrome Active Member

    Messages:
    221
    Likes Received:
    85
    Trophy Points:
    28
    whoa


    cat /dev/urandom

  2. Videodrome

    Videodrome Active Member

    Messages:
    221
    Likes Received:
    85
    Trophy Points:
    28
    I think would be something like:

    #echo "I want add this stuff to this file" >> Text.txt

    >> will put stuff at the end of a file

    Do not do a single >. It will basically overwrite the file.
    Back to the topic, you could quickly view the result:

    #cat text.txt
  3. DevynCJohnson

    DevynCJohnson Well-Known Member Staff Member Staff Writer

    Messages:
    1,379
    Likes Received:
    1,094
    Trophy Points:
    113
    Concatonation -

    cat file1.txt file2.txt | less

    That will allow me to read both files, one right after the other.
    Haider92 likes this.
  4. Saptarshi Nag

    Saptarshi Nag Member

    Messages:
    42
    Likes Received:
    29
    Trophy Points:
    18
    what's the work of 'less' here,as same thing is running without less?
  5. DevynCJohnson

    DevynCJohnson Well-Known Member Staff Member Staff Writer

    Messages:
    1,379
    Likes Received:
    1,094
    Trophy Points:
    113
    The "less" command allows me to view the output with the ability to scroll through the output. Assume a file contains 500 lines of text. Using "cat file.txt" would only show the last few lines of text. So, how would someone scroll up to see the rest? This is when "less" is helpful.

    "more" does the same thing, but "less" offers more features because less is more. :D
  6. Saptarshi Nag

    Saptarshi Nag Member

    Messages:
    42
    Likes Received:
    29
    Trophy Points:
    18
    thanx :D
    DevynCJohnson likes this.

Share This Page