# Bash aliases don't work in Midnight Commander



## d2e8k (Dec 8, 2014)

Hello!
I have some aliases in bash. When I run Midnight Commander from bash, command `alias` has empty output. And, accordingly, aliases can't be executed under MC, I get 
	
	



```
error: /usr/local/bin/bash: ll: command not found
```

MC 4.1.40
Bash 4.3.0
Thanks in advance.


----------



## d2e8k (Dec 8, 2014)

Maybe I explained unclearly. Scenario:

Launch MC
Type `alias` (or `ll`, for example) in command line of MC


```
/usr/local/bin/bash: ll: command not found
```


----------



## zirias@ (Dec 8, 2014)

Where do you set these aliases? Probably, the bash instance run from inside mc just doesn't read them, because it's not run as a _login shell_. See the Bash Reference Manual for details, when which startup file is loaded by bash.


----------



## d2e8k (Dec 8, 2014)

Aliases are defined in ~/.bashrc. I enter to server. In bash command line aliases are working. After that I launch MC. And those aliases are not working in MC command line.


----------



## mlsemon (Dec 10, 2014)

They're working just fine here, with some work. If your login shell is bash, then the alias should be set in .bash_profile. If your login shell is something else, and you invoke bash manually, the aliases work when set from .bashrc. In my instance, if I start bash, then start mc, then the mc shell is still tcsh, which didn't have the aliases set in .cshrc and such, so the aliases didn't work.  If I started mc like `env SHELL=/usr/local/bin/bash mc`, mc did start with bash for the prompt.


----------



## d2e8k (Dec 14, 2014)

My login shell is bash. Aliases were defined in .bash_profile, after I created .bashrc as`ln .bash_profile .bashrc`.
I start `mc` from bash and SHELL in mc has correct value:


```
~>mc
$ env
...
SHELL=/usr/local/bin/bash
```

But after I get:


```
~>mc
$ ll
/usr/local/bin/bash: ll: command not found
```


Where does mc search aliases?


----------



## mlsemon (Dec 15, 2014)

Try this in ~/.bash_profile, and if it doesn't work, try again in ~/.bashrc:


```
alias ll='ls -l'
```
Otherwise, read those man pages for bash(1) (near the bottom of the page) and mc(1) ("The subshell support", a fairly detailed read).  There are varying behaviors, depending on whether the alias is typed in just after starting `mc`, or whether the F10 key has been hit beforehand.  I don't have a full grasp of the behavior yet.


----------

