aboutsummaryrefslogtreecommitdiff
path: root/bin/ls/ls.1
Commit message (Collapse)AuthorAgeFilesLines
* Bump Dd, missed as part of r264098 and related commits.Glen Barber2014-04-131-1/+1
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=264393
* -k option is compliant with POSIX.Greg Lehey2014-04-041-3/+1
| | | | Notes: svn path=/head/; revision=264098
* Typo.Greg Lehey2014-04-031-1/+1
| | | | | | | Reported by: Igor Sobrado. Notes: svn path=/head/; revision=264093
* Add information on standards compliance of many options.Greg Lehey2014-04-031-5/+58
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=264066
* Make -f set -a, as required by the standard.Greg Lehey2014-04-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | From the original OpenBSD commit message: restore the traditional behavior of -f implying -a; apparently Keith Bostic forgot to restore it when the -f flag was put back on 2nd of September 1989, after being removed on 16th of August as a consequence of issues getting it working over NFS, so deviation from traditional UNIX behavior in all BSDs looks like an historical accident; as a side effect, this change accommodates behavior of this option to IEEE Std 1003.1-2008 (``POSIX.1''). joint work with jmc@ (who found the inaccuracy in our implementation), schwarze@ (who provided a detailed tracking of historical facts) and millert@ Submitted by: Igor Sobrado Discussed with: mckusick Obtained from: OpenBSD project MFC after: 2 weeks Notes: svn path=/head/; revision=264064
* Expand the use of stat(2) flags to allow storing some Windows/DOSKenneth D. Merry2013-08-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and CIFS file attributes as BSD stat(2) flags. This work is intended to be compatible with ZFS, the Solaris CIFS server's interaction with ZFS, somewhat compatible with MacOS X, and of course compatible with Windows. The Windows attributes that are implemented were chosen based on the attributes that ZFS already supports. The summary of the flags is as follows: UF_SYSTEM: Command line name: "system" or "usystem" ZFS name: XAT_SYSTEM, ZFS_SYSTEM Windows: FILE_ATTRIBUTE_SYSTEM This flag means that the file is used by the operating system. FreeBSD does not enforce any special handling when this flag is set. UF_SPARSE: Command line name: "sparse" or "usparse" ZFS name: XAT_SPARSE, ZFS_SPARSE Windows: FILE_ATTRIBUTE_SPARSE_FILE This flag means that the file is sparse. Although ZFS may modify this in some situations, there is not generally any special handling for this flag. UF_OFFLINE: Command line name: "offline" or "uoffline" ZFS name: XAT_OFFLINE, ZFS_OFFLINE Windows: FILE_ATTRIBUTE_OFFLINE This flag means that the file has been moved to offline storage. FreeBSD does not have any special handling for this flag. UF_REPARSE: Command line name: "reparse" or "ureparse" ZFS name: XAT_REPARSE, ZFS_REPARSE Windows: FILE_ATTRIBUTE_REPARSE_POINT This flag means that the file is a Windows reparse point. ZFS has special handling code for reparse points, but we don't currently have the other supporting infrastructure for them. UF_HIDDEN: Command line name: "hidden" or "uhidden" ZFS name: XAT_HIDDEN, ZFS_HIDDEN Windows: FILE_ATTRIBUTE_HIDDEN This flag means that the file may be excluded from a directory listing if the application honors it. FreeBSD has no special handling for this flag. The name and bit definition for UF_HIDDEN are identical to the definition in MacOS X. UF_READONLY: Command line name: "urdonly", "rdonly", "readonly" ZFS name: XAT_READONLY, ZFS_READONLY Windows: FILE_ATTRIBUTE_READONLY This flag means that the file may not written or appended, but its attributes may be changed. ZFS currently enforces this flag, but Illumos developers have discussed disabling enforcement. The behavior of this flag is different than MacOS X. MacOS X uses UF_IMMUTABLE to represent the DOS readonly permission, but that flag has a stronger meaning than the semantics of DOS readonly permissions. UF_ARCHIVE: Command line name: "uarch", "uarchive" ZFS_NAME: XAT_ARCHIVE, ZFS_ARCHIVE Windows name: FILE_ATTRIBUTE_ARCHIVE The UF_ARCHIVED flag means that the file has changed and needs to be archived. The meaning is same as the Windows FILE_ATTRIBUTE_ARCHIVE attribute, and the ZFS XAT_ARCHIVE and ZFS_ARCHIVE attribute. msdosfs and ZFS have special handling for this flag. i.e. they will set it when the file changes. sys/param.h: Bump __FreeBSD_version to 1000047 for the addition of new stat(2) flags. chflags.1: Document the new command line flag names (e.g. "system", "hidden") available to the user. ls.1: Reference chflags(1) for a list of file flags and their meanings. strtofflags.c: Implement the mapping between the new command line flag names and new stat(2) flags. chflags.2: Document all of the new stat(2) flags, and explain the intended behavior in a little more detail. Explain how they map to Windows file attributes. Different filesystems behave differently with respect to flags, so warn the application developer to take care when using them. zfs_vnops.c: Add support for getting and setting the UF_ARCHIVE, UF_READONLY, UF_SYSTEM, UF_HIDDEN, UF_REPARSE, UF_OFFLINE, and UF_SPARSE flags. All of these flags are implemented using attributes that ZFS already supports, so the on-disk format has not changed. ZFS currently doesn't allow setting the UF_REPARSE flag, and we don't really have the other infrastructure to support reparse points. msdosfs_denode.c, msdosfs_vnops.c: Add support for getting and setting UF_HIDDEN, UF_SYSTEM and UF_READONLY in MSDOSFS. It supported SF_ARCHIVED, but this has been changed to be UF_ARCHIVE, which has the same semantics as the DOS archive attribute instead of inverse semantics like SF_ARCHIVED. After discussion with Bruce Evans, change several things in the msdosfs behavior: Use UF_READONLY to indicate whether a file is writeable instead of file permissions, but don't actually enforce it. Refuse to change attributes on the root directory, because it is special in FAT filesystems, but allow most other attribute changes on directories. Don't set the archive attribute on a directory when its modification time is updated. Windows and DOS don't set the archive attribute in that scenario, so we are now bug-for-bug compatible. smbfs_node.c, smbfs_vnops.c: Add support for UF_HIDDEN, UF_SYSTEM, UF_READONLY and UF_ARCHIVE in SMBFS. This is similar to changes that Apple has made in their version of SMBFS (as of smb-583.8, posted on opensource.apple.com), but not quite the same. We map SMB_FA_READONLY to UF_READONLY, because UF_READONLY is intended to match the semantics of the DOS readonly flag. The MacOS X code maps both UF_IMMUTABLE and SF_IMMUTABLE to SMB_FA_READONLY, but the immutable flags have stronger meaning than the DOS readonly bit. stat.h: Add definitions for UF_SYSTEM, UF_SPARSE, UF_OFFLINE, UF_REPARSE, UF_ARCHIVE, UF_READONLY and UF_HIDDEN. The definition of UF_HIDDEN is the same as the MacOS X definition. Add commented-out definitions of UF_COMPRESSED and UF_TRACKED. They are defined in MacOS X (as of 10.8.2), but we do not implement them (yet). ufs_vnops.c: Add support for getting and setting UF_ARCHIVE, UF_HIDDEN, UF_OFFLINE, UF_READONLY, UF_REPARSE, UF_SPARSE, and UF_SYSTEM in UFS. Alphabetize the flags that are supported. These new flags are only stored, UFS does not take any action if the flag is set. Sponsored by: Spectra Logic Reviewed by: bde (earlier version) Notes: svn path=/head/; revision=254627
* Add a few examples.Joel Dahl2013-03-151-1/+19
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=248342
* Add y flag and environment variable LS_SAMESORT to specify the sameGreg Lehey2012-11-081-7/+65
| | | | | | | | | | | | | | | | | | | | sorting order for time and name with the -t option. IEEE Std 1003.2 (POSIX.2) mandates that the -t option sort in descending order, and that if two files have the same timestamp, they should be sorted in ascending order of their names. The -r flag reverses both of these sort orders, so they're never the same. This creates significant problems for sequentially named files stored on FAT file systems, where it can be impossible to list them in the order in which they were created. Add , (comma) option to print file sizes grouped and separated by thousands using the non-monetary separator returned by localeconv(3), typically a comma or period. MFC after: 14 days Notes: svn path=/head/; revision=242725
* Get rid of major/minor number distinction.Ed Schouten2011-09-281-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | As of FreeBSD 6, devices can only be opened through devfs. These device nodes don't have major and minor numbers anymore. The st_rdev field in struct stat is simply based a copy of st_ino. Simply display device numbers as hexadecimal, using "%#jx". This is allowed by POSIX, since it explicitly states things like the following (example taken from ls(1)): "If the file is a character special or block special file, the size of the file may be replaced with implementation-defined information associated with the device in question." This makes the output of these commands more compact. For example, ls(1) now uses approximately four columns less. While there, simplify the column length calculation from ls(1) by calling snprintf() with a NULL buffer. Don't be afraid; if needed one can still obtain individual major/minor numbers using stat(1). Notes: svn path=/head/; revision=225847
* Update sticky(7) cross references.Sergey Kandaurov2011-05-131-4/+4
| | | | | | | | PR: docs/124468 X-MFC with: r218998 Notes: svn path=/head/; revision=221845
* Add reference to strmode(3).Edward Tomasz Napierala2009-04-131-0/+1
| | | | Notes: svn path=/head/; revision=191003
* - Add -D to usage().Ruslan Ermilov2008-04-041-2/+3
| | | | | | | | - Bump document date for the addition of the -D option. - Reformat a sentence to look like a real sentence. Notes: svn path=/head/; revision=177908
* Add -D option to specify exact format of date and time output with ls -l.Greg Lehey2008-04-041-6/+28
| | | | Notes: svn path=/head/; revision=177907
* - Improve description of the -A option.Ruslan Ermilov2006-10-121-7/+12
| | | | | | | | | | | - Document how whiteouts look in the long output. [1] - Sort entry types. - Fix description of the socket type. PR: docs/51921 [1] Notes: svn path=/head/; revision=163263
* Markup fixes.Ruslan Ermilov2006-09-171-1/+1
| | | | Notes: svn path=/head/; revision=162379
* Change the -S and -t options to override each other so that the last oneJohn Baldwin2006-03-241-0/+7
| | | | | | | specified wins to make their interaction less confusing. Notes: svn path=/head/; revision=157101
* Add a few more references to -U.John Baldwin2006-03-241-4/+4
| | | | Notes: svn path=/head/; revision=157099
* Add a new -U flag to instruct ls to use the birthtime for printing orJohn Baldwin2006-03-241-0/+2
| | | | | | | | | | sorting. Submitted by: Andrzej Tobola ato at iem dot pw dot edu dot pl MFC after: 1 week Notes: svn path=/head/; revision=157098
* -mdoc sweep.Ruslan Ermilov2005-11-171-3/+1
| | | | Notes: svn path=/head/; revision=152547
* Having three options (-a, -A, -I) controlling the output of dottedRuslan Ermilov2005-11-161-7/+5
| | | | | | | | | | | | | | files is too much and hard to follow. Instead, make the -I option just mean "do not automatically set -A for root". That is, if -A is explicitly set, -I is ignored. Also, document -I in usage(). (The ls.c diff is better viewed relative to rev. 1.80.) No objection: mux Silence from: mnag MFC after: 3 days Notes: svn path=/head/; revision=152469
* Mention the non-standardness of the -I option in ls(1).Maxime Henrion2005-11-101-1/+2
| | | | | | | | Spotted by: ru MFC after: 3 days Notes: svn path=/head/; revision=152281
* Add a -I option to disable the automatic -A flag for the super-user.Maxime Henrion2005-11-101-1/+9
| | | | | | | | | PR: bin/86710 Submitted by: Marcus Alves Grando MFC after: 3 days Notes: svn path=/head/; revision=152256
* fix typos: decribed -> described, preceeded -> precededRalf S. Engelschall2005-09-061-3/+3
| | | | Notes: svn path=/head/; revision=149826
* Improved descriptions of block size handling.Gary W. Swearingen2005-08-311-37/+48
| | | | | | | | | | PR: docs/84765 Submitted by: garys Approved by: keramida MFC after: 3 days Notes: svn path=/head/; revision=149676
* Remove the EXAMPLES section that describes how to sort by size usingDima Dorfman2005-06-031-15/+0
| | | | | | | | | | | | | sort(1). This functionality is provided by the -S option now, and it is useful even though a similar effect is achievable with sort(1), since the latter doesn't work in combination with -h. This option is also present in NetBSD, OpenBSD, and GNU fileutils, so there's clearly a demand for it. Noticed by: asmodai Notes: svn path=/head/; revision=146926
* Improve wording: A sort is "in" a particular order, not "by" aDima Dorfman2005-06-031-2/+2
| | | | | | | particular order. Notes: svn path=/head/; revision=146925
* Add the -S option to sort files by size. NetBSD and OpenBSD alreadyDima Dorfman2005-06-031-4/+6
| | | | | | | | | | | have this option with identical semantics (sorting large files first). -r can be used to reverse the sort if that is desired. PR: 81625 Submitted by: Kostas Blekos <mplekos@physics.upatras.gr>, keramida Notes: svn path=/head/; revision=146924
* Expand *n't contractions.Ruslan Ermilov2005-02-131-2/+2
| | | | Notes: svn path=/head/; revision=141846
* Add the new standard EXIT STATUS section where appropriate.Ruslan Ermilov2005-01-161-17/+17
| | | | | | | Sort standard sections in the (documented) preferred order. Notes: svn path=/head/; revision=140353
* The total sum of blocks for the -l and -s option is printed always,Joerg Wunsch2005-01-111-3/+5
| | | | | | | | | | | | | | regardless whether the output is to a terminal or not. As this is consistent with the SUSPv2 specification (even though we do not otherwise fully implement SUSPv2's ls(1) options), document this as it is now, rather than trying to change the behaviour itself. PR: docs/76072 Submitted by: Sebastian Rey <Sebastian.rey@gmx.net> MFC after: 1 week Notes: svn path=/head/; revision=140050
* /*- or .\"- or #- to begin license clauses.Warner Losh2005-01-101-0/+1
| | | | Notes: svn path=/head/; revision=139969
* Mechanically kill hard sentence breaks.Ruslan Ermilov2004-07-021-1/+1
| | | | Notes: svn path=/head/; revision=131484
* Punctuation.Ruslan Ermilov2004-05-161-1/+1
| | | | Notes: svn path=/head/; revision=129297
* Treat filenames as multibyte character strings (according to the currentTim J. Robbins2004-05-021-5/+1
| | | | | | | | | | | | | | | | LC_CTYPE setting) when determining which characters are printable. This is an often-requested feature. Use wcwidth() to determine the number of column positions a character takes up, although there are still a few places left where we assume 1 byte = 1 column position, e.g. line-wrapping when handling the -m option. The error handling here is somewhat more complicated than usual: we do our best to show what we can of a filename in the presence of conversion errors, instead of simply aborting. Notes: svn path=/head/; revision=128823
* Remove clause 3 from the UCB licenses.Mark Murray2004-04-061-4/+0
| | | | | | | OK'ed by: imp, core Notes: svn path=/head/; revision=127958
* Document incorrect handling of multibyte characters in filenames.Tim J. Robbins2004-03-211-1/+5
| | | | Notes: svn path=/head/; revision=127269
* Do something sensible if both -h and -k are given.David E. O'Brien2003-12-011-0/+8
| | | | | | | Approved by: re(scottl) Notes: svn path=/head/; revision=123089
* Note in STANDARDS that -gno are not (yet?) POSIX conformant.Jens Schweikhardt2003-08-081-1/+6
| | | | | | | | Spotted by: harti MFC after: 3 days Notes: svn path=/head/; revision=118665
* -l prints all permissions, not just owner and groupChristian Brueffer2003-07-101-1/+1
| | | | | | | | | PR: 54294 Submitted by: Per Hedeland <per@hedeland.org> MFC after: 3 days Notes: svn path=/head/; revision=117389
* df(1) and ls(1) print units in 'four or fewer' not 'three or less'.Tom Rhodes2003-05-061-1/+1
| | | | | | | | PR: 35523 Submitted by: Tomas Svensson <tsn@gbdev.net> Notes: svn path=/head/; revision=114791
* Reference maclabel(7).Chris Costello2003-01-201-1/+3
| | | | | | | Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=109601
* mdoc(7) police: markup fixes.Ruslan Ermilov2002-11-251-6/+9
| | | | | | | Approved by: re Notes: svn path=/head/; revision=107229
* Print a `+' character after the standard UNIX permission fields in longTim J. Robbins2002-11-031-2/+20
| | | | | | | | | | | listings if the file has an extended ACL (more than the required 3 entries). This is what Solaris and IRIX do, and what the withdrawn POSIX.2c standard required. Reviewed by: rwatson (an earlier version of the patch) Notes: svn path=/head/; revision=106371
* Teach "ls -Z" to use the policy-agnostic MAC label interfaces ratherRobert Watson2002-10-241-8/+2
| | | | | | | | | | | | | | than the LOMAC-specific interfaces for listing MAC labels. This permits ls to view MAC labels in a manner similar to getfmac, when ls is used with the -l argument. Next generation LOMAC will use the MAC Framework so should "just" work with this and other policies. Not the prettiest code in the world, but then, neither is ls(1). Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=105832
* s/filesystem/file system/ as discussed on -developersTom Rhodes2002-08-211-1/+1
| | | | Notes: svn path=/head/; revision=102230
* mdoc(7) police: fixed the document date.Ruslan Ermilov2002-08-191-1/+1
| | | | | | | Submitted by: iedowse Notes: svn path=/head/; revision=102091
* mdoc(7) police: markup nits.Ruslan Ermilov2002-05-291-2/+3
| | | | Notes: svn path=/head/; revision=97463
* Add missing options required by SUSv3:Tim J. Robbins2002-05-191-10/+23
| | | | | | | | | | | -m List files across the page, separated by commas. -p Print a slash after directory names -x Same as -C but sort across the columns rather than down Submitted by: Kyle Martin <mkm@ieee.org> Notes: svn path=/head/; revision=96892
* Consistancy check s/file system/filesystem/Tom Rhodes2002-05-161-1/+1
| | | | | | | Reviewed by: brian Notes: svn path=/head/; revision=96702
* ls(1) is utility not functionPhilippe Charnier2002-04-161-1/+1
| | | | Notes: svn path=/head/; revision=94868