"ls -F" command appends an asterisk to jpeg files

Asked by John Beatty

I have a directory with two files from my camera, and one subdirectory:

john@desk2:~/test$ ls
output Photo-1.jpg Photo-2.jpg

When I give the command "ls -F" I am surprised to see asterisks after the two jpeg files as these are not executables:
john@desk2:~/test$ ls -F
output/ Photo-1.jpg* Photo-2.jpg*

I would expect "ls -F" to treat jpeg's as ordinary files, and not append an asterisk.

The "file" command confirms them to be jpeg's:
john@desk2:~/test$ file *
output: directory
Photo-1.jpg: JPEG image data, EXIF standard 2.2
Photo-2.jpg: JPEG image data, EXIF standard 2.2
john@desk2:~/test$

System details:
john@desk2:~/test$ uname -a
Linux desk2 2.6.32-26-generic #48-Ubuntu SMP Wed Nov 24 09:00:03 UTC 2010 i686 GNU/Linux

john@desk2:~/test$ ls --version
ls (GNU coreutils) 7.4

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-terminal Edit question
Assignee:
No assignee Edit question
Solved by:
George Standish
Solved:
Last query:
Last reply:
Revision history for this message
Best George Standish (george-standish-deactivatedaccount) said :
#1

John,

This may be working as designed.

From the LS man page

       -F, --classify
              append indicator (one of */=>@|) to entries

If your jpeg files where copied from a windows filesystem (FAT or NTFS) then they will be marked as executable probably.

Use "ls -l" and see if they have an x near the beginning (in the permission section rwx), if they do you should remove the executable with "chmod -x filename.jpg". Once you've done that then "-F" shouldn't show the *

Good luck,
George

Revision history for this message
John Beatty (jby601) said :
#2

Thanks George Standish, that solved my question.