Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

agdgdgdgwngo

Should I use cat or less for viewing text files in Unix?

  • 2 years ago
  • 2 years ago

  • This Question is Closed
  1. agdgdgdgwngo
    Best Response
    You've already chosen the best response.
    Medals 0

    cat [file] prints the file to stdout, whereas less [file] opens it up for viewing, like a manpage

    • 2 years ago
  2. Tomas.A
    Best Response
    You've already chosen the best response.
    Medals 0

    you said what i wanted to say, so why you asking? lol

    • 2 years ago
  3. agdgdgdgwngo
    Best Response
    You've already chosen the best response.
    Medals 0

    I don't know which is the best option :(

    • 2 years ago
  4. Tomas.A
    Best Response
    You've already chosen the best response.
    Medals 0

    i never use cat for viewing because it will spam my terminal but maybe you need sometimes to print something to terminal then you can use it

    • 2 years ago
  5. shoot.me
    Best Response
    You've already chosen the best response.
    Medals 0

    It depends on the context where you use the file to display.. you can even use VI filename on the terminal to see as well as edit just like edit in windows..

    • 2 years ago
  6. rsmith6559
    Best Response
    You've already chosen the best response.
    Medals 0

    If two commands are equivelant to you, the better one is in the /bin directory (as opposed to /usr/bin or /usr/local/bin), or on the recovery disk for your system. That way, if things go south, you won't be "out of your usual" while trying to repair it.

    • 2 years ago
  7. allamiro
    Best Response
    You've already chosen the best response.
    Medals 0

    Less is better

    • 2 years ago
  8. farmdawgnation
    Best Response
    You've already chosen the best response.
    Medals 4

    Use both! cat filename | less :D

    • 2 years ago
  9. keketsu
    Best Response
    You've already chosen the best response.
    Medals 1

    I agree that it depends on the context. If the file is small, cat it because less requires an extra keystroke to escape. If the file is larger and you need to jump to a specific section, less is better. Now if you just want the end of a file, you can use tail. The various options exist because they each have their use.

    • 2 years ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.