command: cat

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

  1. Videodrome

    Videodrome Active Member

    Joined:
    Nov 17, 2013
    Messages:
    328
    Likes Received:
    132
    whoa


    cat /dev/urandom

     
  2. Videodrome

    Videodrome Active Member

    Joined:
    Nov 17, 2013
    Messages:
    328
    Likes Received:
    132
    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

    Joined:
    May 21, 2013
    Messages:
    1,635
    Likes Received:
    1,278
    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

    Joined:
    Jan 26, 2014
    Messages:
    45
    Likes Received:
    29
    what's the work of 'less' here,as same thing is running without less?
     
  5. DevynCJohnson

    DevynCJohnson Well-Known Member Staff Member Staff Writer

    Joined:
    May 21, 2013
    Messages:
    1,635
    Likes Received:
    1,278
    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

    Joined:
    Jan 26, 2014
    Messages:
    45
    Likes Received:
    29
    thanx :D
     
    DevynCJohnson likes this.

Share This Page