Why does my shell think that .bash_aliases is an executable?

C

CrazedNerd

Guest
I've been playing with aliases a bit because they are awesome, i made several aliases to fine-tune the ls command. The one I made that i'm a little confused about, when i use it, is this one:

Code:
alias lsdh='ls -d .* | grep -v *.txt'

the intention is to show only hidden directories, yet the file ".bash_aliases" is color coded green with the * on the display. Why is the shell say my .bash_aliases is an executable? I thought it was just a configuration file, there's no shebang in the file.
 


It display that because it was marked/set 'x' (rwx, r-x) ls -l. You could mark anything chmod u+x file.jpg where 'u' can be any combo of User Group Other.
As for a shebang, #!, it is not required to run a file by explicitly stating the interpreter do so, eg: sh .bashrc
In the case of bashrc, there are commands inside to set variables and do other crap when logging in. That's why it's executed.
 
It display that because it was marked/set 'x' (rwx, r-x) ls -l. You could mark anything chmod u+x file.jpg where 'u' can be any combo of User Group Other.
As for a shebang, #!, it is not required to run a file by explicitly stating the interpreter do so, eg: sh .bashrc
In the case of bashrc, there are commands inside to set variables and do other crap when logging in. That's why it's executed.
Yeah I was trying to make it a file that was backed up by cron in my coding folder but it didn't work. Thanks bud. My other coding templates back up just fine.
 

Members online


Latest posts

Top