Talk:Ls

From Wikipedia, the free encyclopedia

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)


-- Article first made by Brandonforgod

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


"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)


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)


[edit] Credit for sample output

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.

[edit] Color conventions

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)

[edit] File types

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)