Talk:Ls

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Linux  
WikiProject icon This article is within the scope of WikiProject Linux, a collaborative effort to improve the coverage of Linux on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
 ???  This article has not yet received a rating on the project's quality scale.
 ???  This article has not yet received a rating on the project's importance scale.
 

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)

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)

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)

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)

This is a task that is precisely intended for shell scripts to perform, not core userland utilities. Dysprosia 13:43, 4 May 2006 (UTC)
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)
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)

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)

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)

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)

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)

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)

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)

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)


Other List commands[edit]

lshw - list hard ware components;

lsof - list output files;

lsusb - list usb devices;

lspci - list pci devices;


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