Results 1 to 5 of 5

Thread: .txt Compression Problem

  1. #1
    Join Date
    Jun 2010
    Location
    /home/TX
    Beans
    225
    Distro
    Ubuntu 12.04 Precise Pangolin

    .txt Compression Problem

    Hello Ubuntu Forums Community,

    I created a java program that creates a list of prime numbers with the number of primes generated is input as an argument. While trying to clean up some of my hard drive, I ran into this program and input 10,000 as the number
    Code:
    java Primes  10000
    and it output a .txt file with all the primes in it called 10000primes.txt I realized that the file was rather large and tried to compressed it with gzip. when I tried to do it, i got this message:

    gzip: 10000primes.txt has 1 other link -- unchanged

    How do I solve this?
    Thanks in advance.
    "The secret to creativity is knowing how to hide your sources." -Albert Einstein

    Ubuntu User #32977; Linux User #528876

  2. #2
    Join Date
    Jul 2007
    Location
    Austin, TX (formerly D.C)
    Beans
    359
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: .txt Compression Problem

    It doesn't want to change the file because apparently it's a symbolic link (or has a link to it). Try to create a NEW file with the following:

    Code:
    gzip -c file > newfile.gz
    Alternatively, you can compress using tar with the following:

    Code:
    tar -czf file file.tar.gz
    For the one-file case, you can technically just gip it up with gzip. However, you typically see things distributed as tarballs (.tar.gz), which is alalogous to a zipfile under windows -- it can contain multiple files or directories.

    Mike

  3. #3
    Join Date
    Jun 2010
    Location
    /home/TX
    Beans
    225
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: .txt Compression Problem

    what does the ">" do? I'll see if it works.

    UPDATE: Thanks! it works. I'll mark the thread solved now.
    "The secret to creativity is knowing how to hide your sources." -Albert Einstein

    Ubuntu User #32977; Linux User #528876

  4. #4
    Join Date
    Oct 2007
    Beans
    245
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: .txt Compression Problem

    > redirects the output of a command to a file.

  5. #5
    Join Date
    Jun 2010
    Location
    /home/TX
    Beans
    225
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: .txt Compression Problem

    Ah! thanks for your help!
    "The secret to creativity is knowing how to hide your sources." -Albert Einstein

    Ubuntu User #32977; Linux User #528876

Tags for this Thread

Bookmarks

Posting Permissions

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