Usage of the cat command

Discussion in 'Mac Apps and Mac App Store' started by brainwave89, Jan 5, 2014.

  1. brainwave89 macrumors 6502

    Joined:
    Jul 7, 2006
    #1
    How can I use the cat command in terminal to display the contents of a file named sunny windy day.docx?

    Thanks for looking.
     
  2. gr8tfly, Jan 5, 2014
    Last edited: Jan 6, 2014

    gr8tfly macrumors 603

    gr8tfly

    Joined:
    Oct 29, 2006
    Location:
    ~119W 34N
    #2
    "cat" will output the file sequentially, so it would work best with plain text. ".docx" is a Word document.

    (See the man page for "cat": )
    Code:
    man cat
    Or...

    Are you asking why the file isn't recognized because of spaces in the filename? ("cat" still won't work, but the following would help when using a filename with special characters in general)

    You can either enter it contained in quotes:
    Code:
    man "sunny windy day.docx"
    Or, by using the '\' character to denote a special character:
    Code:
    man sunny\ windy\ day.docx
     
  3. jonesea macrumors newbie

    Joined:
    Dec 21, 2013
    #3

    One way is:
    cat "sunny windy day.docx"

    But that's a word file, so your going to get lots of junk on the screen.
     
  4. brainwave89 thread starter macrumors 6502

    Joined:
    Jul 7, 2006
  5. dmi macrumors regular

    Joined:
    Dec 21, 2010
    #5
    To display the junk as visible text
    cat -v "sunny windy day.docx"
     

Share This Page