What does the asterisk mean after a filename when you type `ls -l`?

167

24

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 19:48 ./
drwxr-xr-x 6 james james    4096 2010-08-21 20:43 ../
-rwxr-xr-x 1 james james  341773 2010-05-07 19:47 adb*
-rwxr-xr-x 1 james james    3636 2010-05-07 19:47 android*
-rwxr-xr-x 1 james james    2382 2010-05-07 19:47 apkbuilder*
-rwxr-xr-x 1 james james    3265 2010-05-07 19:47 ddms*
-rwxr-xr-x 1 james james   89032 2010-05-07 19:47 dmtracedump*
-rwxr-xr-x 1 james james    1940 2010-05-07 19:47 draw9patch*
-rwxr-xr-x 1 james james 6886136 2010-05-07 19:47 emulator*
-rwxr-xr-x 1 james james  478199 2010-05-07 19:47 etc1tool*
-rwxr-xr-x 1 james james    1987 2010-05-07 19:47 hierarchyviewer*
-rwxr-xr-x 1 james james   23044 2010-05-07 19:47 hprof-conv*
-rwxr-xr-x 1 james james    1939 2010-05-07 19:47 layoutopt*
drwxr-xr-x 4 james james    4096 2010-05-07 19:48 lib/
-rwxr-xr-x 1 james james   16550 2010-05-07 19:47 mksdcard*
-rw-r--r-- 1 james james  205851 2010-05-07 19:48 NOTICE.txt
-rw-r--r-- 1 james james      33 2010-05-07 19:47 source.properties
-rwxr-xr-x 1 james james 1447936 2010-05-07 19:47 sqlite3*
-rwxr-xr-x 1 james james    3044 2010-05-07 19:47 traceview*
-rwxr-xr-x 1 james james  187965 2010-05-07 19:47 zipalign*

What does that asterisk mean?

I'm also unable to run a particular file, as follows:

james@nevada:~/development/tools/android-sdk-linux_86/tools$ ./emulator 
bash: ./emulator: No such file or directory

EDIT : I'm trying to get Eclipse to use emulator, but it keeps complaining the files does not exist, yet it is here?

user155695

Posted 2010-08-21T20:21:57.210

Reputation: 2 819

3All files are marked as executable on NTFS partitions. – Smile4ever – 2015-11-25T10:35:54.010

@Smile4ever that's simply not true. It depends on how you've mounted the partition and by default it's mounted as all-executable. The same applies to FAT and other non-Unix partitions. However you can also store Unix permissions on NTFS because it's POSIX compatible https://askubuntu.com/q/86959/253474 https://unix.stackexchange.com/q/11757/44425

– phuclv – 2017-10-12T02:50:22.253

@LưuVĩnhPhúc You can mount your partition differently, yes. But by default it's mounted as executable on most Linux distributions. Thanks for the clarification. – Smile4ever – 2017-10-12T18:31:21.177

Answers

81

Ignacio Vazquez-Abrams has already explained about the *:

It means that the file is executable. A classifier is shown when -F is passed to ls via the command line or otherwise.

As for the executable-looking emulator that you can't actually execute, this can happen when the dynamic loader requested by emulator doesn't exist. You can check what kind of file emulator is with the command file emulator, and check what dynamic loader and libraries it needs with ldd emulator (any line showing “not found” is something you need to install).

Given the name of the directory and the size of the file, emulator is probably a Linux x86 binary. I suspect you have an amd64 system. If so, you need to install a runtime environment for 32-bit applications; on Ubuntu, you need the ia32-libs package (and perhaps also ia32-libs-gtk).

You could also get this error message for a script whose interpreter as indicated in the #! line doesn't exist.

Gilles 'SO- stop being evil'

Posted 2010-08-21T20:21:57.210

Reputation: 58 319

1Interesting, I'll give what you suggested a shot. Only thing that confuses me is that I had this running yesterday, and since then have only restarted... :S – user155695 – 2010-08-21T21:19:13.517

-bash: ./badshebang: /bin/xyzzy: bad interpreter: No such file or directory – Paused until further notice. – 2010-08-21T21:58:34.380

80

It means that the file is executable. A classifier is shown when -F is passed to ls via the command line or otherwise.

Ignacio Vazquez-Abrams

Posted 2010-08-21T20:21:57.210

Reputation: 100 516

35

From info ls:

`-F'
`--classify'
`--indicator-style=classify'
     Append a character to each file name indicating the file type.
     Also, for regular files that are executable, append `*'.  The file
     type indicators are `/' for directories, `@' for symbolic links,
     `|' for FIFOs, `=' for sockets, `>' for doors, and nothing for
     regular files.

user46971

Posted 2010-08-21T20:21:57.210

Reputation: 1 000

4+1 for teaching fishing as well as giving the fish. – atoMerz – 2017-11-08T07:57:01.603

21

Ubuntu (12.04, and probably other versions as well) includes the following setting by default:

alias ll='ls -alF'

And as others have explained, -F is responsible for the asterisk.

IPython automatically uses the F flag under the hood (by default), so just entering ls will produce the effect you're seeing there.

Edit: by the way, you are stating you're running ls -l, running ll may not be the same at all.

dk1844

Posted 2010-08-21T20:21:57.210

Reputation: 311

7A fun trick you can do in Bash is type the alias'd command (e.g. "ll") and press [Ctrl]+[Alt]+[e]. It'll expand the alias so you can see what it's actually processing. (you might have to press it a few times to fully expand) – Adam – 2015-05-07T00:35:17.880

9

As several others have mentioned, the -F option to ls will flag executables with the asterisk. You don't have a -F in your command line, but it is likely that ls has been aliased. You can check for aliases in your shell of choice (in bash, use the built-in command alias to list the aliases), or escape the ls command with a backslash to disable aliasing.

mpez0

Posted 2010-08-21T20:21:57.210

Reputation: 2 578