Talk:ls

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia


Article first made by Brandonforgod[edit]

Note: I think the wikipedia idea is really cool, and surprisingly to me, I think has come out very well! Note2: this is my first Wikipedia article! Note3: Please mail comments / encouragements to brandonforgod at ameritech dot net, but please don't sign me up for any mailing lists. I thought it was fun to create this article, so I may create more in the future!

Hello & welcome to the Wikipedia, Brandonforgod. We don't sign or put comments in the actual articles. If you log in you can create a user page for yourself. -- Tarquin 19:22 Dec 16, 2002 (UTC)
Thank you for cleaning up the document so that the ls page looks like ls. I didn't know about that *pre* thing before. (Whatever it means.)
Quick note: The free-editing ability of Wikipedia for encyclopedia entries seems cool and effective to me. However, the free-editing of comments like this (where you may change the comments of yourself and other's seems a little dangerous. It seems like it should be a rule that no one may edit anyone else's comments. - Brandonforgod
You're right, and it is a rule: we don't edit other people's comments. But equally, we don't have comments in articles. I merely moved your comment here to the talk page associated with the article, I didn't change it: this is the accepted course of action. -- Tarquin 00:10 Dec 17, 2002 (UTC)

Note: Unfortunately, in the course of attempting to format this article, I lost the bigness of the titles. I assume someone (like Tarquin ;-)) knows how to fix that. Additionally, it seems that with some of my lists of information, I've found them jammed into one line. As a result, I added some temorary semicolons to separate the data, but have left major formatting alone. Perhaps someone like Tarquin may be able to fix that. The way I wanted it to look is very similar to what may be seen in edit view. -- Brandonforgod

Other note: Sorry if the mass of minor edits was a b it much. I didn't quite understand how to use the "Show preview" feature. I actually considered complaining because it seemed not to work properly. But I notice now that the preview is located at the bottom of the page. It seems that this is a big enforcement of what seems to be a recent lesson of mine: with systems like these I should problably check things out quite thoroughly before opening my big mouth to complain.  :-)

Finally, thanks again for your input and helpful revisions to this article. I didn't actually expect such a quick response. Indeed, I doubted my article would barely even be noticed! But apparently Wikipedia is way cooler than that ;-) -- Brandonforgod

First person[edit]

"I think" and "I don't know" are suboptimal for Wikipedia--leave things blank or find them out. All this information is in the man pages; if we're going to document Unix commands, let's get it right.

Also, Wikipedia style is to avoid the first person in articles: it's not about what you or I know, but about (in this case) the ls command. Vicki Rosenzweig 00:12 Apr 8, 2003 (UTC)

Move to discussion[edit]

Nice article, I thought I would just move this block to the discussion page so it didnt clutter up your article.

Jedi Dan 19:15 Apr 23, 2003 (UTC)

Credit for sample output[edit]

This search is from Cygwin, using the:

GNU bash, version 2.05b.0(5)-release (i686-pc-cygwin) Copyright (C) 2002 Free Software Foundation, Inc.

(Please, someone delete and email me about it on the address at the bottom of this article if my listing is found to be against Wikipedia's rules, because of the copyright on the version) If found otherwise, why not delete this paragraph?!

I downloaded Cygwin for free at http://cygwin.com, so you may be able to download it yourself there to try it yourself / get more official documentation.

This is bash output. No connection at all with ls. 79.77.32.208 (talk) 15:03, 13 May 2008 (UTC)[reply]

Permissions[edit]

There are two pages that talk about the same notation for permissions: this one and then File system permissions. The two should be merged somehow. --Kbolino 09:16, 12 Feb 2005 (UTC)

Color conventions[edit]

What are the color conventions when using color? Is it different from shell to shell?

--Velle 13:40, 4 May 2006 (UTC)[reply]

See the example in the article I added using color conventions for Suse Linux. It can be different, depending on your preferences. Use the dircolors -p command to see how they are set for your shell.
There is a good explanation on setting your colors here. In short:
Create the file with: 
dircolors -p > $HOME/.dircolors 
Edit the file to taste. 
In your .bashrc (and/or .bash_profile or .profile) put: 
eval $(dircolors ~/.dircolors) 
--Unixguy 12:38, 17 May 2006 (UTC)[reply]

File types[edit]

I know that you are able to get the type of a file by typing "file pic.jpg" for example. Is it possible to get this information for each file or subdirectory in a directory using ls with some argument?

--Velle 13:39, 4 May 2006 (UTC)[reply]

This is a task that is precisely intended for shell scripts to perform, not core userland utilities. Dysprosia 13:43, 4 May 2006 (UTC)[reply]
Here is a one-liner to answer your question. Use the find command with the -exec option.
find . -exec file {} \;
--Unixguy 12:40, 17 May 2006 (UTC)[reply]
You probably want it to only operate on files (it will still traverse subdirectories, just won't feed their names to the file command).
find . -type f -exec file {} \;
--Serge 22:15, 17 May 2006 (UTC)[reply]

History: ls stands for "list segments"?[edit]

The first section and the "history" section mention that "ls" stands for "list segments". I have two problems with that claim:

  1. It doesn't provide much insight for the reader and is even confusing. The ls command clearly lists files, not segments. What the hell is a segment anyway?
  2. Also, I doubt that the claim is correct:

If that claim does turn out to be correct, mention it in the history section, quoting a source. Section 0 should not feature it in any case because of reason 1. Just my two cents. --193.99.145.162 15:15, 17 April 2007 (UTC)[reply]

ls stands for list, I remember there being a list/glossary of all the common unix command names, sadly I can't seem to find it. It would make a great source! I've found multiple pages confirming it, but not the list.
Adrianjcc (talk) 23:28, 13 January 2008 (UTC)[reply]

final answer: I have uncovered "proof" that "ls" stands for "list" and not "list segments"; the long term confusion stems from, yes, Multics used the term "segments" as a "somewhat synonym" for files, and yes the "list" command could be abbreviated "ls", and the ls command could in fact "list segments". However, if we look at the instructions for the "list (ls)" command http://web.mit.edu/multics-history/source/Multics/doc/info_segments/list.info we see that ls could list other things, and if you invoked it with the -segment argument, then it would "list segments". QED (stronger than original recollections, imho) 68.173.49.156 (talk) 01:33, 13 October 2014 (UTC)[reply]

//from http://web.mit.edu/multics-history/source/Multics/doc/info_segments/list.info

Syntax as a command:  ls {entrynames} {-control_args}
...
Control arguments (entry type):
-segment, -sm
   list segments.
-multisegment_file, -msf
   list multisegment files.
-data_management_file, -dmf
   lists data management files.
-file, -f
   list information about files (i.e., segments, MSFs, and DM files).
   (Default)
-directory, -dr
   list directories.

Update History[edit]

It needs more references to verify it, but the history segment could be updated. It doesn't exactly conflict but there's a hole in the information between other sources and wikipedia. It seems that listf in CTSS has an older history than list in Multics does even.

References:

  1. http://linuxgazette.net/issue48/fischer.html
  2. http://web.mit.edu/multics-history/source/Multics/doc/info_segments/list.info

204.101.124.98 (talk) 18:23, 19 February 2008 (UTC)[reply]

yes, listf in CTSS has an older history, but the shortening of the name to list and then ls was in Multics which did import the name from CTSS. The original Unix team was well familiar with both CTSS and Multics. Not sure if this article needs that much history, I think here the weird abbreviation is what needs mention rather than the concept of listing something. BTW, here we are talking about actual lists of things, but over the years listings usually refer to printing out files (yes, those are lists of lines which were from stacks of cards, I'm just saying) 68.173.49.156 (talk) 01:42, 13 October 2014 (UTC)[reply]

Could we have some comparison of ls varients?[edit]

I'd like to see some discussion of ls varients. It is of special concern to me at this moment because my documentation says I should be able to use "--hide=" and "--ignore=" options, but neither of my two ls varients (cygwin and Microsft's Windows Service's for Linux) support them. But I'd think it would be good info to add even if I weren't in immediate need for it.

Practical article[edit]

It's nice to see a practical article. It would also be useful to mention that aliases may cause what happens on a users computer to diverge from the behaviors described in the article.


SL?[edit]

Could we add in the SL command as a subsection or possibly an article of its own? It's a noteworthy command and is an animation of a Steam Locomotive (SL) to penalize careless users. Centrisian (talk) 06:56, 28 October 2008 (UTC)[reply]

How is it notable? It certainly isn't widely installed comparing to ls. Chris Cunningham (not at work) - talk 07:33, 28 October 2008 (UTC)[reply]

Arguments[edit]

The ls command comes with quite a few arguments, is there a reason we aren't listing them for further comment? Watchwolf49 (talk) 15:06, 6 March 2010 (UTC)[reply]

ls example[edit]

Hello, on one of the examples on the text, a call to ls generates output that gives a hard-link count of 1 to a directory. I thought that that was not possible since a directory must contain a link to itself and a link to its parent. Should it be changed? Brusegadi (talk) 09:19, 24 August 2010 (UTC)[reply]


Other List commands[edit]

lshw - list hard ware components;

lsof - list output files;

lsusb - list usb devices;

lspci - list pci devices;

lsblk - list block devices; — Preceding unsigned comment added by Necdetyucel (talkcontribs) 15:40, 23 January 2021 (UTC)[reply]


any more? — Preceding unsigned comment added by 80.74.227.132 (talk) 10:50, 28 April 2013 (UTC)[reply]

Unpublished sources[edit]

There's no verifiable material for the details of Solaris 9 beta, because it was never published, only available under NDA. That precludes it from being a reliable source TEDickey (talk) 23:59, 5 November 2014 (UTC)[reply]

This claim is if course wrong. Many people outside to Sun have been in the Solaris 9 beta program, there was no NDA and new functions even have been discussed in the usenet.

On the other side, information on Wikipedia should not be biased and thus must use the same rules for both FreeBSD and Solaris. We will need to remove your claim for FreeBSD ls.c unless you tell us which final FreeBSD release added this feature and when the FCS of this final release has been. We of course may stay with the dates when a specific source code change appeared on both, but then we need to list October 2001 for Solaris, which is the date when the source change happened and that source change is before the related source change in FreeBSD. Schily (talk) 10:46, 6 November 2014 (UTC)[reply]

{{cleanup html}}[edit]

I could not find anything wrong with the current HTML tags in use (i.e. <code> and <samp>, instead of <tt>). They seem to be in agreement with the Wikipedia HTML spec, more specifically on monospaced text. Thus, I have removed the {{cleanup html}} template.

Avelludo 02:39, 15 March 2019 (UTC)[reply]