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

learn more… | top users | synonyms

23
votes
3answers
8k 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 ...
6
votes
2answers
3k 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 ...
12
votes
3answers
8k 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?
8
votes
4answers
2k 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
279 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 ...
1
vote
3answers
2k 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 ...
8
votes
2answers
538 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?
6
votes
3answers
309 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 ...
3
votes
4answers
7k 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 create ...