#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2010
    Posts
    2
    Rep Power
    0

    Unhappy I haven't seen the copying i need


    i've spent 3 hours on google trying to find the answer to this. i have a directory full of .txt files and files that got misextentioned, but are supposed to be .txt files. i want to combine all of them into one big .txt file. cat *.* bigfile.txt doesn't work, because *.* isn't a file or directory, so how do i tell it all? if * isn't all then how the eff do i say it??
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    Code:
    cat * > bigfile.txt
    Works under bash
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Brony & F/OSS Advocate
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2003
    Location
    Anaheim, CA (USA)
    Posts
    6,653
    Rep Power
    2475
    A single asterisk ("*") is a glob which means it matches all files in the current directory

    I think your error is in the call to cat:
    Code:
    $ cat * bigfile.txt
    would append the content of all files and "bigfile.txt" and output it to the terminal (standard output). If you want to instead store that output, you need to use output redirection, using the ">" operator:
    Code:
    $cat * > bigfile.txt
    (In each of these examples, "$" is your shell prompt.)
    Last edited by codergeek42; October 19th, 2010 at 11:49 PM.
    ~~ Peter ~~ :: ( Who am I? ) :: ( Peter's Musings: Uploading myself, bit by bit... ) :: ( Electronic Frontier Foundation ) :: ( I'm a GNU/Linux addict and Free Software Advocate. ) :: ( How to Ask Questions the Smart Way ) :: ( The Fedora Project, sponsored by Red Hat ) :: ( GNOME: The Free Software Desktop Project ) :: ( GnuPG Public Key ) :: ( About me on the WIki )
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2010
    Posts
    2
    Rep Power
    0
    yes i see my error now thank you now it's compiling them i appreciate the help. first i wasn't putting in the > before the target. then i was using the *.* instead of * i'm so used to winblows terminal that it's hard to switch over
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2010
    Location
    ~
    Posts
    12
    Rep Power
    0
    "*.*" doesn't work in Linux because Linux does not require that files have extensions. It doesn't even have any concept of them at the OS level (but some programs can might pay attention to them).

IMN logo majestic logo threadwatch logo seochat tools logo