summaryrefslogtreecommitdiffstats
path: root/bin/ls
Commit message (Collapse)AuthorAgeFilesLines
* Add a few examples.joel2013-03-151-1/+19
| | | | Obtained from: OpenBSD
* When WCHAR_MIN == 0 the check if a wchar_t value will always be true. Inandrew2013-01-061-1/+4
| | | | this case skip the test as gcc complains it is always true.
* Undo over-aggressive conversion of spaces to tabs. ie: those withinpeter2012-11-092-6/+6
| | | | format strings, "period, space, space" in comment text, etc.
* Replace spaces with tabs where appropriate.grog2012-11-086-36/+36
| | | | Reminded by: jh@
* Add y flag and environment variable LS_SAMESORT to specify the samegrog2012-11-086-21/+110
| | | | | | | | | | | | | | | | | 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
* Sort option parsing as far as practical.grog2012-11-071-41/+42
|
* Fix bin/ build with a 64-bit ino_t.mdf2012-09-272-7/+11
| | | | Original code by: Gleb Kurtsou
* Add build opton MK_LS_COLORS to control whether ls(1) supports colorsmarcel2012-05-191-1/+4
| | | | | | | (and thus needs to depend on libtermcap). Embedded systems may not want or need colors. Obtained from: Juniper Networks, Inc.
* If ls was invoked with -i but neither -l nor -s, blocksize was used indes2011-10-191-2/+2
| | | | | | | display() to calculate column widths, but was not initialized in main(). This resulted in a division by zero. Noticed by: Michael Butler <imb@protected-networks.net>
* When calculating the width of the blocksize column, ls(1) used 512-bytedes2011-10-181-2/+2
| | | | | | | units (as returned by stat(2)) instead of BLOCKSIZE units. Submitted by: Paul Schenkeveld MFC after: 3 weeks
* Get rid of major/minor number distinction.ed2011-09-284-39/+20
| | | | | | | | | | | | | | | | | | | | | | 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).
* Update sticky(7) cross references.pluknet2011-05-131-4/+4
| | | | | PR: docs/124468 X-MFC with: r218998
* Change all our own code to use st_*tim instead of st_*timespec.ed2010-03-281-32/+32
| | | | Also remove some local patches to diff(1) which are now unneeded.
* Make sure that FTS_COMFOLLOW is not set when the -P option is in effect.jh2010-02-081-2/+6
| | | | | | | | | | Otherwise the -i option will show the inode number of the referenced file for symbolic links given on the command line. Similarly, the file color was printed according to the link target in colorized output. PR: bin/102394 Reviewed by: jilles MFC after: 2 weeks
* Fixes for ls(1) long format (-l) output:jh2010-01-243-21/+50
| | | | | | | | | | - Allow -h option to work if the listing contains at least one device file. - Align major and minor device numbers correctly to the size field. PR: bin/125678 Approved by: trasz (mentor) MFC after: 1 month
* Print full path in the error message. It's possible that fts(3)jh2010-01-241-1/+1
| | | | | | | | | | provides an empty fts_name and reporting the full path is more appropriate especially with the -R option. PR: bin/107515 Submitted by: bde Approved by: trasz (mentor) MFC after: 1 week
* ls: Make -p not inhibit following symlinks.jilles2009-10-131-1/+1
| | | | | | | | | According to the man page, when neither -H/-L nor -F/-d/-l are given, -H is implied. This agrees with POSIX, GNU ls and Solaris ls. This means that -p, although it is very similar to -F, does not prevent the implicit following of symlinks. PR: standards/128546
* Fix regression introduced in r196712 - the 'name' string needstrasz2009-09-021-5/+9
| | | | | | to be rewritten for each file we want to check ACL on. Without this change, ls(1) would check only the ACL on the first file to list.
* Add NFSv4 ACL support to ls(1).trasz2009-08-311-52/+54
|
* Add reference to strmode(3).trasz2009-04-131-0/+1
|
* Turn a tab into a space. This fixes a misalignment for ls -l.imp2008-04-051-2/+2
| | | | Tabs Noticed by: Antoine Brodin
* - Add -D to usage().ru2008-04-042-4/+5
| | | | | - Bump document date for the addition of the -D option. - Reformat a sentence to look like a real sentence.
* Add -D option to specify exact format of date and time output with ls -l.grog2008-04-044-16/+46
|
* Avoid a spurious warning for each whiteout found during "ls -lW".ru2006-10-181-2/+3
| | | | | | | | # ls -lW total 2 -rw-r--r-- 1 root wheel 6 Oct 18 14:46 file1 ls: ./file2: No such file or directory w--------- 0 root wheel 0 Jan 1 1970 file2
* - Improve description of the -A option.ru2006-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]
* Markup fixes.ru2006-09-171-1/+1
|
* Change the -S and -t options to override each other so that the last onejhb2006-03-242-0/+10
| | | | specified wins to make their interaction less confusing.
* Fix a bug such that if you enabled sorting by size (-S) and enabled ajhb2006-03-241-4/+4
| | | | | | | | | flag to use a time other than modtime (-c, -u, or -U), the output would actually be sorted by the specified time rather than size. This does alter the behavior in the case where both -S and -t are specified. Now, -S is always preferred. Previously, -t was preferred if one of -c, -u, or -U was specified, and -S was preferred otherwise. Perhaps -S and -t should override each other (last one specified wins).
* Add a few more references to -U.jhb2006-03-241-4/+4
|
* Add a new -U flag to instruct ls to use the birthtime for printing orjhb2006-03-247-4/+49
| | | | | | | sorting. Submitted by: Andrzej Tobola ato at iem dot pw dot edu dot pl MFC after: 1 week
* -mdoc sweep.ru2005-11-171-3/+1
|
* Having three options (-a, -A, -I) controlling the output of dottedru2005-11-163-20/+14
| | | | | | | | | | | 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
* Mention the non-standardness of the -I option in ls(1).mux2005-11-101-1/+2
| | | | | Spotted by: ru MFC after: 3 days
* Add a -I option to disable the automatic -A flag for the super-user.mux2005-11-102-9/+25
| | | | | | PR: bin/86710 Submitted by: Marcus Alves Grando MFC after: 3 days
* fix typos: decribed -> described, preceeded -> precededrse2005-09-061-3/+3
|
* Improved descriptions of block size handling.garys2005-08-311-37/+48
| | | | | | | PR: docs/84765 Submitted by: garys Approved by: keramida MFC after: 3 days
* Remove the EXAMPLES section that describes how to sort by size usingdd2005-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
* Improve wording: A sort is "in" a particular order, not "by" add2005-06-031-2/+2
| | | | particular order.
* Add the -S option to sort files by size. NetBSD and OpenBSD alreadydd2005-06-035-12/+43
| | | | | | | | 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
* Expand *n't contractions.ru2005-02-131-2/+2
|
* Sync program's usage() with manpage's SYNOPSIS.ru2005-02-091-2/+2
|
* Add the new standard EXIT STATUS section where appropriate.ru2005-01-161-17/+17
| | | | Sort standard sections in the (documented) preferred order.
* The total sum of blocks for the -l and -s option is printed always,joerg2005-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
* /*- or .\"- or #- to begin license clauses.imp2005-01-106-6/+6
|
* Mechanically kill hard sentence breaks.ru2004-07-021-1/+1
|
* Fix some style bugs I introduced pointed out by bde. Also add a blankdwmalone2004-06-231-15/+23
| | | | | | line after the empty variable declarations. Reviewed by: md5
* Use nanoseconds and then lexicographic ordering when the seconds ofdwmalone2004-06-221-6/+42
| | | | | | | | the [acm]time are the same. I was going to use Scott's patch, but I couldn't get the style quite right, so I used a patch of my own. Submitted by: Scott Mitchell <scott+freebsd at fishballoon.org> MFC after: 3 weeks
* If we are asked to print the total number of blocks, do so even if wedas2004-06-081-12/+14
| | | | | | | | | | | | | have no entries to print (either due to an empty directory or an error). This makes the -l and -s options more consistent, like Solaris and (Debian) Linux. To make this happen, tweak two optimizations on the second call to display(): - Don't skip display() altogether, even if list == NULL. - Don't skip the call to the printfn in display() if we need to print the total. PR: 45723
* Remove from the printfns the assumption that dp->list != NULL. Evendas2004-06-081-2/+6
| | | | | if there are no entries, these functions may be called to print the total number of blocks (0) for consistency's sake.
* Plug small memory leak.le2004-06-031-0/+1
| | | | | | PR: bin/67392 Submitted by: Matthew Emmerton <matt@gsicomp.on.ca> MFC in: 1 week
OpenPOWER on IntegriCloud