2

When I extract a tar file using this command: tar xvzf gcc-4.7.1.tar.gz

(This is the directory the tar file is in: cd /u/test/GCC-4.7.1/)

The files were extracted but they are in /dev/... (see below for actual file paths and names) - How do I install GCC from this point now?

This is probably related to my other question, but I am now using SCO 6 (not SCO 5.0.7) and a new GCC compiler.

The files I extracted are not in the same folder where the tar file is either.

Extracting files

Below are the exact steps I took to extract and search for the files I extracted:

  1. cd /u/test/GCC-4.7.1/
  2. tar xvzf gcc-4.7.1.tar.gz
  3. cd /u/test/GCC-4.7.1/
  4. ls -la

The only file in there is the tar file.

Edit

The tar extracted successfully showing this:

key    Device           Block   Size(K)  Tape
0    /dev/rfdo48ds9      18     360      No
1    /dev/rfd148dx9      18     360      NO
2    /dev/rfd096ds15     10     1200     NO
3    /dev/rfd196ds15     10     1200     NO
4    /dev/rfd0135ds9     18     720      NO
5    /dev/rfd1135ds9     18     720      NO
6    /dev/rfd0135ds18    18     1440     NO
7    /dev/rfd1135ds18    18     1440     NO
8    /dev/rct0           20     0        YES
9    /dev/rctmini        20     0        YES
10   /dev/rdsk/fp03d     18     720      NO
11   /dev/rdsk/fp03h     18     1440     NO
12   /dev/rdsk/fp03v21   10     20330    NO
Kevdog777
  • 3,224

1 Answers1

6

The files were extracted but they are in /dev/...

I doubted that could happen when I first read your question, because tar programs have for many years been stripping leading / from paths automatically for security reasons. Without that protection, you could ship someone a malicious tarball that overwrote system files. Think of the fun you could have by shipping someone hand-crafted /etc/passwd and /etc/shadow files, for example. A tar program that doesn't strip leading / would extract them over the existing files. However, I did some research and found that SCO OpenServer 6 doesn't provide that protection by default! You have to give the A flag to get that behavior. Ugh.

That said, I still doubt it did what you claim unless you were logged in as root, which I doubt given the /u/test stuff in your question. A regular user can't create files in /dev unless someone's been monkeying with the default file permissions.

Since you gave the v flag to tar, you should have gotten a list of files if the extraction went off successfully. Did you? Could you post that list somewhere, such as at pastebin.com?

Do you have GNU tar installed already? If you're using SCO tar, it doesn't understand the z flag for un-gzipping the file before un-tarring it. Say gzip -dc gcc-4.7.1.tar.gz | tar xAvf - instead.

Warren Young
  • 72,032
  • I have added the Successful extraction in the description, as the VM I am using, I can't copy and paste the list of files. So I had to write it out in the description instead. – Kevdog777 Jul 30 '12 at 12:17
  • I have just tried the gzip -dc gcc-4.7.1.tar.gz | tar xAvf and that has shown: tar: device argument required - I executed this script as root. – Kevdog777 Jul 30 '12 at 12:19
  • @Kevdog777: You must have missed the dash argument at the end. As for getting the file list out of the VM: gzip -dc gcc-4.7.1.tar.gz | tar xAvf - > file-list 2>&1, then send the file out somehow. FTP, email, Z-modem... – Warren Young Jul 30 '12 at 12:25
  • Ah, that helps, haha. Well it sort of helped, it was better than the previous error. I now got: tar: suppressing absolute pathnames tar: 1 file(s) not extracted – Kevdog777 Jul 30 '12 at 12:29
  • Sorry I now forgot the > symbol. It looks like it is trying to do something now. – Kevdog777 Jul 30 '12 at 12:31
  • Is that file-list 2>&1 a file / directory path? Where do the files go after extracting? It has been a while since I last did this, and forgot how I did it last time. – Kevdog777 Aug 17 '12 at 15:46
  • No, file-list is a file; it contains a list of files. 2>&1 is a redirection operator. This is not the place to explain what it means to you. And the files go where they normally would, just as if you'd left the > file-list 2>&1 off. Did you not try any of this before asking? A simple ls would have answered all of your questions. – Warren Young Aug 17 '12 at 16:08
  • I know what a simple ls is, that will show a simple list of all files and folders in that folder. I didn't try any of this, as I did not know any of this before asking, hence why I asked in the first place. – Kevdog777 Aug 20 '12 at 07:35
  • Ignorance isn't anything to be ashamed of, kevdog, but what you're displaying here is an unwillingness to even try answering your questions on your own first. Go google up some info on Bash and tar. It will answer questions you didn't even know you had yet. – Warren Young Aug 20 '12 at 16:33