<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: File command in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/file-command/m-p/2493015#M19769</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The file command uses a file called 'magic' to map the contents of a sequence of bytes at or near the beginning of the file to the type of the file.&lt;BR /&gt;&lt;BR /&gt;For example, if the first bytes of a file are '#!/usr/bin/perl', the file command decides that it is a perl script.&lt;BR /&gt;&lt;BR /&gt;This works for binary files too, as they have a signature to identify them.&lt;BR /&gt;&lt;BR /&gt;Have a look at the /etc/magic file, and you can see for yourself how it does the trick.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Rik.</description>
    <pubDate>Tue, 13 Feb 2001 16:33:07 GMT</pubDate>
    <dc:creator>RikTytgat</dc:creator>
    <dc:date>2001-02-13T16:33:07Z</dc:date>
    <item>
      <title>File command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-command/m-p/2493012#M19766</link>
      <description>Hi &lt;BR /&gt;&lt;BR /&gt;How does a file command work?. Will it open file for reading? If it opens why the acccess time doesn't change?&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Feb 2001 15:57:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-command/m-p/2493012#M19766</guid>
      <dc:creator>Satish Y</dc:creator>
      <dc:date>2001-02-13T15:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: File command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-command/m-p/2493013#M19767</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Direct from the man page:&lt;BR /&gt;==&lt;BR /&gt;file performs a series of tests on each file in an attempt to classify it.  If file appears to be an ASCII file, file examines the first 512 bytes and tries to guess its language.  If file is an executable a.out file, file prints the version stamp, provided it is greater than 0.&lt;BR /&gt;==&lt;BR /&gt;&lt;BR /&gt;In short, the file command provides information about its type and version (binary) where possible.&lt;BR /&gt;&lt;BR /&gt;Hope this helps. Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong&lt;BR /&gt;Brainbench MVP for Unix Admin&lt;BR /&gt;&lt;A href="http://www.brainbench.com" target="_blank"&gt;http://www.brainbench.com&lt;/A&gt;</description>
      <pubDate>Tue, 13 Feb 2001 16:18:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-command/m-p/2493013#M19767</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2001-02-13T16:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: File command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-command/m-p/2493014#M19768</link>
      <description>Hi Satish,&lt;BR /&gt;&lt;BR /&gt;'file' opens the file(s) given as arguments, performs a series of test in an attempt to classify them.&lt;BR /&gt;For files having a magic number, file uses /etc/magic.&lt;BR /&gt;&lt;BR /&gt;As the file is opened, the access time is modified.  If you type 'ls -lutr' in a directory where you issued the file command, you'll see the last accessed file at the end.&lt;BR /&gt;(-u flag to reflect last access time instead of last modification)&lt;BR /&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;&lt;BR /&gt;Dan&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Feb 2001 16:28:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-command/m-p/2493014#M19768</guid>
      <dc:creator>Dan Hetzel</dc:creator>
      <dc:date>2001-02-13T16:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: File command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-command/m-p/2493015#M19769</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;The file command uses a file called 'magic' to map the contents of a sequence of bytes at or near the beginning of the file to the type of the file.&lt;BR /&gt;&lt;BR /&gt;For example, if the first bytes of a file are '#!/usr/bin/perl', the file command decides that it is a perl script.&lt;BR /&gt;&lt;BR /&gt;This works for binary files too, as they have a signature to identify them.&lt;BR /&gt;&lt;BR /&gt;Have a look at the /etc/magic file, and you can see for yourself how it does the trick.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Rik.</description>
      <pubDate>Tue, 13 Feb 2001 16:33:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-command/m-p/2493015#M19769</guid>
      <dc:creator>RikTytgat</dc:creator>
      <dc:date>2001-02-13T16:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: File command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-command/m-p/2493016#M19770</link>
      <description>Hi Satish:&lt;BR /&gt;&lt;BR /&gt;Interesting, indeed.  I too have read the man pages and would expect the last access date as returned by "ls -ul" to change -- it clearly doesn't.  The inode timestamp (as returned by "ls -cl" DOES CHANGE.  Perhaps 'file' is restoring the lastaccess timestamp after it reads the file (?).&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 13 Feb 2001 16:34:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-command/m-p/2493016#M19770</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2001-02-13T16:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: File command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-command/m-p/2493017#M19771</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;From the man page, it appears that the file is opened for reading regardless of whether it is ascii or binary. &lt;BR /&gt;&lt;BR /&gt;I did a test and you are indeed right that the last access time is not updated even though the file is opened. ls -lu does not reflect the new access time when the file command is used.&lt;BR /&gt;&lt;BR /&gt;My guess is that the "file" command "touch" the file back to its original access time.&lt;BR /&gt;&lt;BR /&gt;Regards.&lt;BR /&gt;&lt;BR /&gt;Steven Sim Kok Leong&lt;BR /&gt;Brainbench MVP for Unix Admin&lt;BR /&gt;&lt;A href="http://www.brainbench.com" target="_blank"&gt;http://www.brainbench.com&lt;/A&gt;</description>
      <pubDate>Tue, 13 Feb 2001 16:36:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-command/m-p/2493017#M19771</guid>
      <dc:creator>Steven Sim Kok Leong</dc:creator>
      <dc:date>2001-02-13T16:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: File command</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/file-command/m-p/2493018#M19772</link>
      <description>Hi James,&lt;BR /&gt;&lt;BR /&gt;You're right. I should have checked instead of simply believing...  !-(&lt;BR /&gt;&lt;BR /&gt;'ls -lct' reflects the inode timestamp change&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Dan&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Feb 2001 16:42:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/file-command/m-p/2493018#M19772</guid>
      <dc:creator>Dan Hetzel</dc:creator>
      <dc:date>2001-02-13T16:42:16Z</dc:date>
    </item>
  </channel>
</rss>

