Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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>*

E.g.

helloworld*

Instead of

helloworld

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: http://hocuspokus.net/2008/01/a-better-ls-for-mac-os-x/

So if it ties in, that's great.

share|improve this question

migrated from stackoverflow.com Feb 12 '13 at 14:00

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

1  
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
add comment

1 Answer 1

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-


Edit

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
add comment

Your Answer

 
discard

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.