Find the answer to your Linux question:
Results 1 to 8 of 8
hey there I noticed a funny thing happening with cat cmd. When on prompt (root) i typed cat * and executed it . My monitor was bombarded with alien character ...
  1. #1
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493

    Funny thing with 'cat' cmd

    hey there
    I noticed a funny thing happening with cat cmd. When on prompt (root) i typed cat * and executed it . My monitor was bombarded with alien character and it kept on runnning for sometime , after breaking out of it my promt became unreadable does anyone know y is it happenig.....

  2. #2
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    depends where you ran it. But sounds like your cat command included binary files....
    That can often screw up your session.
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

  3. #3
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493

    ?????

    hey thanks for replying bro. I'm writing this here cause you don't want any PM. Although I got you point but do you have any idea why is it happening like that?

  4. #4
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    Well binary files are full of non printing control characters, some sequences get interpreted and screw up your session.

    Why would you want to "cat" everything anyway? If your looking for something use grep...
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

  5. #5
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    "cat *" means "cat everything in the current directory", which will show the contents of all the files in the current dir (that's what * stands for).

    Between all the files probably there were some binary (i.e. files that do not contain plain text). These files contains characters that can screw up your display since they are not interpreted as text as matonb said.

  6. #6
    Linux Guru
    Join Date
    Nov 2004
    Posts
    6,110
    When you cat a binary file and mess up your terminal, you can run the command reset to fix your terminal for you.
    Last edited by bigtomrodney; 04-03-2009 at 11:05 AM.

  7. #7
    Linux Enthusiast
    Join Date
    Aug 2006
    Location
    Portsmouth, UK
    Posts
    539
    Well pointed out bigtom, ye ol' reset has has come in handy a few times
    RHCE #100-015-395
    Please don't PM me with questions as no reply may offend, that's what the forums are for.

  8. #8
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493

    problem solved

    Cheers guys thanks for helping me out

Posting Permissions

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