Questions relating to the Linux 'list' command (ls)

learn more… | top users | synonyms

35
votes
4answers
17k views

Difference between 'dir' and 'ls' terminal commands?

I've been trying to find the difference between using the dir and ls commands in terminal. I know ls is the traditional unix method of viewing the files in a directory, and that dir is the windows ...
19
votes
5answers
9k views

In the output of 'ls -n', what does the the second column mean?

When I run: ls -n I get something like: -rwxrwxrwx 1 1000 1000 765528 2009-10-15 18:41 file1 drwxr-xr-x 10 1000 1000 4096 2010-12-07 20:50 dir1 drwxr-xr-x 3 1000 1000 4096 2010-10-24 ...
0
votes
2answers
689 views

What does 'ls -al' do?

When I entered the -al attribute with the ls command, I got the following: anupam@JAZZ:~/blog$ ls -al total 76 drwxrwxr-x 13 anupam anupam 4096 Aug 28 21:45 . drwxr-xr-x 34 anupam anupam 4096 Aug 28 ...
8
votes
2answers
6k views

Best way to list 100 first files in a directory sorted by time

What would be the best way to list 100 first files in a directory sorted by the created timestamp (oldest first). The directory is quite large (around 100000 files). ls piped to head takes an awful ...
17
votes
3answers
15k views

How to activate pagination for ls command?

What is the equivalent option for the ls command to activate pagination as in DOS the dir /p does?
9
votes
5answers
4k views

How to find all PDF files in directories and their subdirectories?

I want to list all PDF files in the directories of the current working directory. What command can do this? I remember a combination of ls and */*.pdf but don't remember what exact combination.
4
votes
1answer
355 views

Nautilus sort order with ls

I am creating image sprites and have neatly named around 100 files. I am using the following to generate an image sprite from individual images: convert $(ls -w 1000) +append sprite.png I have just ...
2
votes
3answers
6k views

List files of particular extension

Ok this is strange. I am using this code, ls *.prj To list all the files with the .prj extension in the dir but I am getting this error, bash: /bin/ls: Argument list too long I eventually ...
9
votes
2answers
1k views

What does the l command do?

There is a command l available on my machine which appears to do nothing. which l also produces no output. Is this a real command, and does it actually do anything?
9
votes
3answers
1k views

Tell `ls` to sort by regular ASCII codes, not “intelligently”

I have a couple files and ls sorts them like this: a _b c but I want to have _b a c How can I do that?
6
votes
3answers
545 views

How do you get details from the output of the locate command?

When I run the ls -l command I get details about the files in the current directory like permissions, owner, group, file size. Is there a way I can get these same details instead of just the ...
5
votes
6answers
36k views

listing files in a directory without listing subdirectories and their contents in that directory

I want to create a list of all the files in a directory, without listing any of the subdirectories that reside in that same directory, and print that list to a new file. ls -d * > filelist will ...
3
votes
2answers
82 views

locate command finds a file's path, but the file does not exist in that path [duplicate]

I have written: locate Origin90SR2DVD.iso And I received the path where that file is located: /home/david/Origin90SR2DVD.iso Then I have written: cd /home/david I have run: ls -lrth And ...