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

learn more… | top users | synonyms

22
votes
5answers
12k 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 ...
43
votes
4answers
26k 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 ...
4
votes
2answers
2k views

What does each part of the `ls -la` output mean? [duplicate]

What do the following numbers represent?
4
votes
2answers
4k views

What does 'ls -la' 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 ...
11
votes
2answers
2k 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?
40
votes
3answers
73k views

How do I change the color for directories with ls in the console?

On my console the color for directories is such a blue, that it is hard to read on a dark background. How can I change the color definitions for ls?
10
votes
2answers
9k 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 ...
13
votes
1answer
1k views

What do the symbols like =, * and | in the output of “ls -F” mean?

I am working on creating a 'cheat sheet' of shell commands. I am currently researching the ls command and its flags. For the -F flag I know what the majority of the appended indicators mean but for; = ...
2
votes
2answers
2k views

ls system command not showing terminal colors

I've just been fooling around with some code in C, an example of a really basic program is as follows which just, obviously, lists the directories using the ls system command. #include <stdio.h>...
3
votes
1answer
5k views

Difference between ls -l , ls -ltr and ll?

When i am using these commands , i am getting the same output but only order is getting changed for ls -ltr command. Can anyone please tell me what is the difference between the below commands? ll ...
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?
3
votes
2answers
4k views

Using ls and cd comands on network folders

Super-new linux/terminal user here- Is it possible to use ls and cd comands directly on directories within a public folder on a NAS, or does the share need to me mounted within the root directory ...
0
votes
2answers
676 views

What is the la command?

I just mistyped ls as la. Without noticing, I ran it: tim@Hairy:~$ la detection.sh output-2.jpg output-4.jpg output-6.jpg output-8.jpg Test1.pdf output-1.jpg output-3.jpg output-5.jpg output-...
27
votes
7answers
110k views

How to list all symbolic links in a directory

I have a symbolic link in my /var/www/ directory that links to WordPress. When I run the command ls -la from the /var/www/ directory the link to WordPress doesn't show up. Is there a way to list all ...
19
votes
3answers
22k 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?
11
votes
5answers
7k 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.
6
votes
3answers
774 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 ...
4
votes
1answer
382 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 ...
3
votes
3answers
10k 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
6answers
63k 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
803 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 ...