Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to add certain strings to file types in the bash "ls" command.

For example, "ls"-ing a directory with an .exe inside, would appear as

<file name>*



Instead of


Note: the * appended.

How might I acheive this? I don't have any experience with bash so I don't know what to Google, but bless my socks I did try for a good hour.

I have already customized the bash colours using this:

So if it ties in, that's great.

share|improve this question

migrated from Feb 12 '13 at 14:00

This question came from our site for professional and enthusiast programmers.

ls -F appends * for executables and / for directories – sotapme Feb 11 '13 at 16:10
@sotapme I want this permanently, as I will use it for other file types. – tsujp Feb 11 '13 at 16:13

The * represent an executable, this can be achieved with -F option to the ls.

The first place to look for anything in *nix is the man page for that command. Try to make a habbit of reading man pages, they have a lot of info.

Do a man ls to get all info about the command-switches, options and output of this command.

Some references-


You can also create an alias if you need that behaviour always. Example in bash shell you can do

 alias ls='ls -F --color=auto'
share|improve this answer
I want this as permanent setting I can alter, and call with simply ls as I will be using it for other file types. I will read man now though. – tsujp Feb 11 '13 at 16:15
@tsujp, add the alias to your ~/.bashrc file – glenn jackman Feb 11 '13 at 17:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.