⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 output

📁 unix 下的C开发手册,还用详细的例程。
💻
📖 第 1 页 / 共 2 页
字号:
If&lt;<i>ownername</i>&gt;or&lt;<i>groupname</i>&gt;cannotbedetermined,orif<b>-n</b>isgiven,theyarereplacedwiththeirassociatednumericvaluesusingtheformat%u.<p>The&lt;<i>dateandtime</i>&gt;,fieldwillcontaintheappropriatedateandtimestampofwhenthefilewaslastmodified.InthePOSIXlocale,thefieldistheequivalentoftheoutputofthefollowing<i><a href="date.html">date</a></i>command:<pre><code>date "+%b %e %H:%M"</code></pre>ifthefilehasbeenmodifiedinthelastsixmonths,or:<pre><code>date "+%b %e  %Y"</code></pre>(wheretwospacecharactersareusedbetween<b>%e</b>and<b>%Y)</b>ifthefilehasnotbeenmodifiedinthelastsixmonthsorifthemodificationdateisinthefuture,exceptthat,inbothcases,thefinalnewlinecharacterproducedby<i><a href="date.html">date</a></i>isnotincludedandtheoutputisasifthe<i><a href="date.html">date</a></i>commandwereexecutedatthetimeofthelastmodificationdateofthefileratherthanthecurrenttime.WhentheLC_TIMElocalecategoryisnotsettothePOSIXlocale,adifferentformatandorderofpresentationofthisfieldmaybeused.<p>Ifthefileisacharacterspecialorblockspecialfile,thesizeofthefilemaybereplacedwithimplementation-dependentinformationassociatedwiththedeviceinquestion.<p>Ifthepathnamewasspecifiedasa<i>file</i>operand,itwillbewrittenasspecified.<p>Thefilemodewrittenunderthe<b>-l</b>,<b>-g</b>,<b>-n</b>and<b>-o</b>optionsconsistsofthefollowingformat:<p><code><pre><tt>"%c%s%s%s%c"</tt>, &lt;<i>entry&nbsp;type</i>&gt;,&lt;<i>owner&nbsp;permissions</i>&gt;,&lt;<i>group&nbsp;permissions</i>&gt;,&lt;<i>other&nbsp;permissions</i>&gt;,&lt;<i>optional&nbsp;alternate&nbsp;access&nbsp;method&nbsp;flag</i>&gt;</pre></code><p>The&lt;<i>optionalalternateaccessmethodflag</i>&gt;isasinglespacecharacterifthereisnoalternateoradditionalaccesscontrolmethodassociatedwiththefile;otherwise,aprintablecharacterisused.<p>The&lt;<i>entrytype</i>&gt;characterdescribesthetypeoffile,asfollows:<dl compact><dt>d<dd>Directory.<dt>b<dd>Blockspecialfile.<dt>c<dd>Characterspecialfile.<dt>p<dd>FIFO.<dt>-<dd>Regularfile.</dl><p>Implementationsmayaddothercharacterstothislisttorepresentother,implementation-dependent,filetypes.<p>Thenextthreefieldsarethreecharacterseach:<dl compact><dt>&lt;<i>ownerpermissions</i>&gt;<dd><font color=green size=-2>deleted text:</font><strike><br></strike>Permissionsforthefileownerclass(see<b>fileaccesspermissions</b>inthe<b>XBD</b>specification,<a href="../xbd/glossary.html"><b>Glossary</b>&nbsp;</a>).<dt>&lt;<i>grouppermissions</i>&gt;<dd><font color=green size=-2>deleted text:</font><strike><br></strike>Permissionsforthefilegroupclass.<dt>&lt;<i>otherpermissions</i>&gt;<dd><font color=green size=-2>deleted text:</font><strike><br></strike>Permissionsforthefileotherclass.</dl><p>Eachfieldhasthreecharacterpositions:<ol><p><li>Ifr,thefileisreadable;if"-",itisnotreadable.<p><li>Ifw,thefileiswritable;if"-",itisnotwritable.<p><li>Thefirstofthefollowingthatapplies:<dl compact><dt><b>S</b><dd>Ifin&lt;<i>ownerpermissions</i>&gt;,thefileisnotexecutableandset-user-IDmodeisset.Ifin&lt;<i>grouppermissions</i>&gt;,thefileisnotexecutableandset-group-IDmodeisset.<dt><b>s</b><dd>Ifin&lt;<i>ownerpermissions</i>&gt;,thefileisexecutableandset-user-IDmodeisset.Ifin&lt;<i>grouppermissions</i>&gt;,thefileisexecutableandset-group-IDmodeisset.<dt><b>x</b><dd>Thefileisexecutableorthedirectoryissearchable.<dt><b>-</b><dd>NoneoftheattributesofS,sorxapplies.</dl><p>Implementationsmayaddothercharacterstothislistforthethirdcharacterposition.Suchadditionswill,however,bewritteninlower-caseifthefileisexecutableorsearchable,andinupper-caseifitisnot.<p></ol><p>Ifanyofthe<b>-l</b>,<b>-g</b>,<b>-n</b>,<b>-o</b>or<b>-s</b>optionsisspecified,eachlistoffileswithinthedirectorywillbeprecededbyastatuslineindicatingthenumberoffilesystemblocksoccupiedbyfilesinthedirectoryin512-byteunits,roundeduptothenextintegralnumberofunits,ifnecessary.InthePOSIXlocale,theformatis:<p><code><pre><tt>"total %u\n"</tt>, &lt;<i>number of units in the directory</i>&gt;</pre></code><p>Ifmorethanonedirectory,oracombinationofnon-directoryfilesanddirectoriesarewritten,eitherasaresultofspecifyingmultipleoperands,orthe<b>-R</b>option,eachlistoffileswithinadirectorywillbeprecededby:<p><code><tt>"\n%s:\n"</tt>,&lt;<i>directoryname</i>&gt;</code><p>Ifthisstringisthefirstthingtobewritten,thefirstnewlinecharacterisnotwritten.Thisoutputprecedesthenumberofunitsinthedirectory.<p>Ifthe<b>-s</b>optionisgiven,eachfileshallbewrittenwiththenumberofblocksusedbythefile.Alongwith<b>-C</b>,<b>-1</b>,<b>-m</b>or<b>-x</b>,thenumberandaspacecharacterprecedethefilename;with<b>-g</b>,<b>-l</b>,<b>-n</b>or<b>-o</b>,theyprecedeeachlinedescribingafile.</blockquote><h4><a name = "tag_001_014_1299">&nbsp;</a>STDERR</h4><blockquote>Usedonlyfordiagnosticmessages.</blockquote><h4><a name = "tag_001_014_1300">&nbsp;</a>OUTPUT FILES</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_1301">&nbsp;</a>EXTENDED DESCRIPTION</h4><blockquote>None.</blockquote><h4><a name = "tag_001_014_1302">&nbsp;</a>EXIT STATUS</h4><blockquote>Thefollowingexitvaluesarereturned:<dl compact><dt>0<dd>Allfileswerewrittensuccessfully.<dt>&gt;0<dd>Anerroroccurred.</dl></blockquote><h4><a name = "tag_001_014_1303">&nbsp;</a>CONSEQUENCES OF ERRORS</h4><blockquote>Default.</blockquote><h4><a name = "tag_001_014_1304">&nbsp;</a>APPLICATION USAGE</h4><blockquote>Manyimplementationsusetheequalsign(=)andtheatsign(@)todenotesocketsboundtothefilesystemandsymboliclinks,respectively,forthe<b>-F</b>option.Similarly,manyhistoricalimplementationsusethescharacterandthelcharactertodenotesocketsandsymboliclinks,respectively,astheentrytypecharactersforthe<b>-l</b>option.<p>Itisdifficultforanapplicationtouseeverypartofthefilemodesfieldof<i>ls</i><b>-l</b>inaportablemanner.Certainfiletypesandexecutablebitsarenotguaranteedtobeexactlyasshown,asimplementationsmayhaveextensions.Applicationscanusethisfieldtopassdirectlytoauserprintoutorprompt,butactionsbasedonitscontentsshouldgenerallybedeferred,instead,tothe<i><a href="test.html">test</a></i>utility.<p>Theoutputof<i>ls</i>(withthe<b>-l</b>andrelatedoptions)containsinformationthatlogicallycouldbeusedbyutilitiessuchas<i><a href="chmod.html">chmod</a></i>and<i><a href="touch.html">touch</a></i>torestorefilestoaknownstate.However,thisinformationispresentedinaformatthatcannotbeuseddirectlybythoseutilitiesorbeeasilytranslatedintoaformatthatcanbeused.Acharacterhasbeenaddedtotheendofthepermissionsstringsothatapplicationswillatleasthaveanindicationthattheymaybeworkinginanareatheydonotunderstandinsteadofassumingthattheycantranslatethepermissionsstringintosomethingthatcanbeused.Futureissuesorrelateddocumentsmaydefineoneormorespecificcharacterstobeusedbasedondifferentstandardadditionaloralternativeaccesscontrolmechanisms.<p>Aswithmanyoftheutilitiesthatdealwithfilenames,theoutputof<i>ls</i>formultiplefilesorinoneofthelonglistingformatsmustbeusedcarefullyonsystemswherefilenamescancontainembeddedwhitespace.Systemsandsystemadministratorsshouldinstitutepoliciesandusertrainingtolimittheuseofsuchfilenames.<p>Thenumberofdiskblocksoccupiedbythefilethatitreportsvariesdependingonunderlyingfilesystemtype,blocksizeunitsreportedandthemethodofcalculatingthenumberofblocks.Onsomefilesystemtypes,thenumberistheactualnumberofblocksoccupiedbythefile(countingindirectblocksandignoringholesinthefile);onothersitiscalculatedbasedonthefilesize(usuallymakinganallowanceforindirectblocks,butignoringholes).</blockquote><h4><a name = "tag_001_014_1305">&nbsp;</a>EXAMPLES</h4><blockquote>Anexampleofasmalldirectorytreebeingfullylistedwith<i>ls</i><b>-laRF</b><b>a</b>inthePOSIXlocale:<pre><code>total 11drwxr-xr-x   3 hlj      prog          64 Jul  4 12:07 ./drwxrwxrwx   4 hlj      prog        3264 Jul  4 12:09 ../drwxr-xr-x   2 hlj      prog          48 Jul  4 12:07 b/-rwxr--r--   1 hlj      prog         572 Jul  4 12:07 foo*a/b:total 4drwxr-xr-x   2 hlj      prog          48 Jul  4 12:07 ./drwxr-xr-x   3 hlj      prog          64 Jul  4 12:07 ../-rw-r--r--   1 hlj      prog         700 Jul  4 12:07 bar</code></pre></blockquote><h4><a name = "tag_001_014_1306">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>The<b>-s</b>usesimplementation-dependentunitsandcannotbeusedportably;itmaybewithdrawninafutureissue.<p>TheIEEEPASC1003.2InterpretationsCommitteehasforwardedconcernsaboutpartsofthisinterfacedefinitiontotheIEEEPASCShellandUtilitiesWorkingGroupwhichisidentifyingthecorrections.AfuturerevisionofthisspecificationwillalignwithIEEEStd.1003.2bwhenfinalised.</blockquote><h4><a name = "tag_001_014_1307">&nbsp;</a>SEE ALSO</h4><blockquote><i><a href="chmod.html">chmod</a></i>,<i><a href="find.html">find</a></i>,the<b>XSH</b>specificationdescriptionof<i><a href="../xsh/sysstat.h.html">&lt;sys/stat.h&gt;</a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX&reg;isaregisteredTrademarkofTheOpenGroup.<br>Copyright&copy;1997TheOpenGroup<br>[<a href="../index.html">MainIndex</a>|<a href="../xshix.html">XSH</a>|<a href="../xcuix.html">XCU</a>|<a href="../xbdix.html">XBD</a>|<a href="../cursesix.html">XCURSES</a>|<a href="../xnsix.html">XNS</a>]</font></center><hr size=2 noshade></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -