LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Filerupted after tar command (https://www.linuxquestions.org/questions/linux-server-73/filerupted-after-tar-command-4175559568/)

sagar666 11-22-2015 08:13 AM

Filerupted after tar command
 
Hi,

I have created iostat report file from last 3 days and I am able to read file. Just now try to compressed file using tar (Actually it not compressed)and after compressed tried to read it but it not showing any thing .

Below are commands i tried

985 ls -lh iostat_output
986 tar -zf iostat_output
987 tar --help
988 tar -cf iostat_output
989 tar -cf iostat_output iostat
990 ls -lh iostat_output
991 cat iostat_output
992 tar -xf iostat_output
993 cat iostat_output

Its not displaying any output.

TB0ne 11-22-2015 09:13 AM

Quote:

Originally Posted by sagar666 (Post 5453563)
Hi,
I have created iostat report file from last 3 days and I am able to read file. Just now try to compressed file using tar (Actually it not compressed)and after compressed tried to read it but it not showing any thing .

Again, as you have been asked for TWO YEARS now, you need to PROVIDE ACTUAL DETAILS. The subject of this thread is "filerupted after tar command"...what, exactly, is 'filerupted'?? You say "it now showing any thing", but don't say what it IS doing.
Quote:

Below are commands i tried

985 ls -lh iostat_output
986 tar -zf iostat_output
987 tar --help
988 tar -cf iostat_output
989 tar -cf iostat_output iostat
990 ls -lh iostat_output
991 cat iostat_output
992 tar -xf iostat_output
993 cat iostat_output

Its not displaying any output.
...and AGAIN, as you've been asked MANY TIMES, you need to use CODE TAGS, and ask a clear question. Based on what you posted, it's not clear WHAT you're trying to do. Did you bother to try reading the man page on the tar command? Because:
Quote:

Originally Posted by Sagar666
  • 985 ls -lh iostat_output
  • 986 tar -zf iostat_output
  • 987 tar --help
  • 988 tar -cf iostat_output
  • 989 tar -cf iostat_output iostat
  • 990 ls -lh iostat_output
  • 991 cat iostat_output
  • 992 tar -xf iostat_output
  • 993 cat iostat_output

  • 985 - Lists symlinks and checks them. Nothing to do with creating a tar file, but checking an existing one
  • 986 - Says to use a file and further zip compress, but doesn't put the actual CREATE directive in it
  • 987 - How, exactly, does "--help" factor in?
  • 988 - Great, you've created a file...but you again didn't read the man page, since the FIRST filename is the name of the archive to create. You overwrote your iostat file with blank data, since the output file probably doesn't exist, does it?
  • 989 - Pretty much the same as 988.
  • 990 - Again, why?
  • 991 - cat'ing the file does what? You zeroed out the file(s) previously
  • 992 - Now you want to extract files...from the empty file you created?
  • 993 - Again, why?
Read the man page, or see ANY of the many thousands of easily-found examples on how to create a tar file on Google.

berndbausch 11-22-2015 09:35 AM

Quote:

Originally Posted by sagar666 (Post 5453563)
Just now try to compressed file using tar

The purpose of tar is to combine several files in an archive, not to compress files.
To compress a file, use commands like gzip or xz.

Quote:

Originally Posted by sagar666 (Post 5453563)
985 ls -lh iostat_output
986 tar -zf iostat_output
987 tar --help
988 tar -cf iostat_output
989 tar -cf iostat_output iostat
990 ls -lh iostat_output
991 cat iostat_output
992 tar -xf iostat_output
993 cat iostat_output

Its not displaying any output.

None of the above commands display any output? Unlikely.
So which command doesn't display any output?

TB0ne 11-22-2015 12:35 PM

Quote:

Originally Posted by berndbausch (Post 5453592)
The purpose of tar is to combine several files in an archive, not to compress files.
To compress a file, use commands like gzip or xz.

None of the above commands display any output? Unlikely. So which command doesn't display any output?

You're right...but, with the addition of the z option, it will create a gzipp'ed file after the tar operation completes. And the commands he ran above, show that he gave a command that pretty much used the input file as the output file..meaning the OP zeroed out the input file (lines 988 and 989).

The gzip option will vary by version of tar, but it's pretty standard these days.


All times are GMT -5. The time now is 07:01 AM.