The command to list the contents of a folder/directory in Unix and Unix-like systems.

learn more… | top users | synonyms

13
votes
7answers
22k views

How can I list only non-empty files using ls?

How can I list (using ls) all files that are not empty (size > 0) using linux?
41
votes
6answers
24k views

How do I get ls --color=auto to work on Mac OS X?

I'm trying to move my bash configuration from Ubuntu to Mac OS X and it looks like ls is slightly different. For instance, it won't accept the --color option. How do I get this to work?
51
votes
5answers
62k views

what does the asterisk mean after a filename if you do ls -l

I've done an ls -l inside a directory, and my files are displaying like this : james@nevada:~/development/tools/android-sdk-linux_86/tools$ ll total 9512 drwxr-xr-x 3 james james 4096 2010-05-07 ...
1
vote
2answers
758 views

How do I interpret “total 18” in the output of the “ls -l” command in Solaris10?

auyantepui# ls -l total 18 drwxr-xr-x 2 root sys 512 May 23 13:11 READMEs/ drwxr-xr-x 2 root sys 1024 May 23 13:11 bin/ drwxr-xr-x 2 root sys 512 May 23 13:09 docs/ drwxr-xr-x 2 ...
23
votes
2answers
15k views

How do I interpret the results of the `ls -l` command?

I want to learn about the meaning of values for example first line; drwxr-xr-x 2 ataka root 4096 2008-11-04 16:58 ataka is ataka here the owner of directory ? kioutsovkm@orkide:/users/lnxsrv2/ee$ ...
6
votes
1answer
2k views

Ubuntu's ls can show unicode characters, but tree cannot, even with tree --charset unicode

Ubuntu 10.04's ls can show unicode characters, but tree cannot, even with tree --charset unicode or utf8. Is there a way to solve it. echo could interpret the escape characters except cat list.txt | ...
3
votes
3answers
1k views

Is there a tool on Unix, Linux, Mac, Windows, Ubuntu, that will list file / directory structure?

I wonder if there is a tool that will list file / directory (i.e. take a snapshot of the folder and file structure) like the following: audio mp3 song1.mp3 some other song.mp3 audio books ...
45
votes
7answers
23k views

What does the @ mean on the output of “ls” on OS X' terminal?

When doing an ls in a directory I get the following output: drwxr-xr-x@ 12 xonic staff 408 22 Jun 19:00 . drwxr-xr-x 9 xonic staff 306 22 Jun 19:42 .. -rwxrwxrwx@ 1 xonic staff 6148 25 ...
1
vote
1answer
769 views

the commands ls and get of ftp are not working in vmware

Iam using vmware player version 3.1 to boot a minix 3 os image. After booting the minix os I want to get some files from a server using ftp. the ftp connection to the server works but when i use the ...
5
votes
2answers
12k views

How can I sort ls by owner and group?

How can I list directories with ls and sort them by their owner and group?
1
vote
1answer
414 views

How do I change the color of binaries listed by 'ls'?

In Mac OS X, when I do ls the binary files have red color, how change this color to green? Similar to other Unix.
53
votes
11answers
38k views

How to sort first directories then files etc… when using “ls” in Unix

I would like to use ls command to first show direcotries and then files. I tried ls -la | sort -k 1 But I got a wrong order.
2
votes
2answers
2k views

ls in cmd window gives one hour off time

I have ls installed on my Windows XP computer. It came with msysgit. I've had it a while and it turns out I use it quite a lot even in the DOS prompt. More than dir. The thing is that it gives me ...
0
votes
3answers
1k views

Bash: overridding ls -la with ls -la | more (basic bash scripting problem)

Pretty new to bash scripting. Trying to over ride the ls -la command to be: ls -la | more (Seems more useful for me). I added this to the end of my .bashrc. 154 # alias 'ls -la'='ls -la | ...
0
votes
1answer
346 views

Would linux map the owner id of files coming from other computers to the account name in /etc/passwd?

When I use ls -al to show files downloaded from internet, -rw-rw-r-- 1 427 6011 7544 Jul 20 2006 INSTALL -rw-rw-r-- 1 427 6011 4229 Dec 9 15:36 Makefile.am -rw-rw-r-- 1 427 6011 27893 ...
1
vote
1answer
961 views

Why are some files in ls -l on Mac OSX (Snow Leopard) tagged with “@”? [duplicate]

Possible Duplicate: What does the @ in ls -al mean? When doing an ls -l some files are tagged with "@" like this: -rw-r--r--@ 1 master staff 2074042 Feb 3 19:26 ...
2
votes
2answers
3k views

List files based on modification times

How can I run the ls command with all its options and list all files in directories recursively and sort it based on last modification times? ie ls -lth on all files in directories recursively
3
votes
2answers
2k views

directory listing on Mac OS X

I dumped a bunch of files (music and otherwise) onto my shiny new Macbook, and since I'm more comfortable with linux than Mac (at this point) I tend to use the terminal. I did a ls -al on the files ...
0
votes
1answer
1k views

Total folder size with ls -lh

I created a directory where I put ten files, each one with exactly 1,048,576 characters (1024^2). The size of each one of them should be exactly one megabyte, counting megabyte as 1024^2 bytes. If I ...
6
votes
4answers
1k views

Pass the output of ls to diff

I have one file that contains a list of files from a server, and a local folder that I compare to that manifest. Obviously, I do 'ls -1 > listing_local' and then diff that file with listing_server. ...
12
votes
8answers
34k views

Tell `ls` to print only the base filename

This is the default behaviour of ls ls /net/nas/data/languages/pypm/sites/rex/free/2.6/*/pool/v/vi/virtual*1.4.4*pypm ...
10
votes
1answer
8k views

ls and du shows VERY different size!

I am downloading a file with rtorrent, But when i check the folder that the file is located on ,the filesize with ls command is 4.4GB but when i check the disk with du command it shows me 219MB, also ...
17
votes
2answers
9k views

What does the @ in ls -al mean? [duplicate]

Possible Duplicate: ls -la symbolics… what does that last symbol mean? What does the @ in the below execution of ls -al mean? atom:Lib fak$ ls -al total 1056 drwxr-xr-x 5 fak staff ...
8
votes
3answers
10k views

What is the meaning of 'T' in the execution permissions of a directory?

I just found this confusing output of the ls command: whodare@ubuntu~ $: ls -l /var/spool/cron/ total 12 drwxrwx--T 2 daemon daemon 4096 Oct 29 05:02 atjobs drwxrwx--T 2 daemon ...
8
votes
2answers
29k views

How to find all soft links (symbolic links) in current directory?

Question relates to shell-scripting in bash. How to check with a script which files within the current directory are soft links? In case I have used the wrong term, when I say soft links, I am ...
23
votes
0answers
24k views

ls -la symbolics… what does that last symbol mean?

Possible Duplicate: what does the @ mean on the output of ls on os x terminal? when I type ls -la I get this familiar output... drwxr-xr-x+ 38 kent staff 1292 Nov 6 11:09 . ...
0
votes
3answers
379 views

what does tail + number does? What about head

I just called this command ls -l | tail +3. Firstly, ls -s, produces 3 lines, adding piping strips first line and then prints each file names on a separate line. How does it do that? It doesn't make ...
0
votes
4answers
237 views

How can I do `ls` on a dotfile?

ls on a dotfile My directory contains: $ ls -A .dotfile20091021 file20091020 file20091021 I want to list ALL files containing 20091021 in their name. If I run: $ ls -A *20091021* ...
2
votes
2answers
2k views

How to change the default --color preference for "ls' on Windows?

I'm using ls (from Msys) on Windows. By default, ls doesn't colour-code directories and archives, but that's something I want. I'm tired of typing "ls -C" and "ls --color". Is there any way apart from ...
0
votes
6answers
4k views

Linux: list contents of sub directories with given name?

I'm using linux to analyze a windows directory structure. The structure is: /Documents and settings /username1 /My Documents ... /username2 /My Documents ... ... What command ...
4
votes
5answers
4k views

Listing everything else than *{.tex, .aux} by ls

How can you ls everything else the the files *{.tex, .aux}? I run unsuccessfully ls -I".tex"
9
votes
0answers
9k views

what is the @ after the permissions for in ls -l on a mac? [duplicate]

Possible Duplicate: ls -la symbolics… what does that last symbol mean? Consider the following output from ls -l on OS X 10.5.8 drwxr-xr-x 3 user staff 102 Aug 26 20:21 ...
703
votes
7answers
482k views

How can I sort the output of 'ls' by last modified date?

How can I sort the output of ls by last modified date?