I use eshell-parse-command 'ls -l'
and I got this:
(progn (eshell-trap-errors
(eshell-named-command "ls" (list "-l"))))
Then I write a alias in my .emacs file:
(defalias 'ls
(progn ...))
But I doesn't work. I don't know why.
Add following code to your configuration file.
(require 'em-alias)
(add-to-list 'eshell-command-aliases-list (list "ls" "ls -l"))
The easiest way to add alias to eshell is:
Open eshell,
alias alias-name definition
Eshell will automatically write it into ~/emacs.d/eshell/alias
(don't edit it yourself).
For example:
alias sau sudo aptitude update
Then you can type sau
to launch sudo aptitude update.
Type alias
(in eshll, of course) will list all the alias you've defined.
Some useful alias:
Map find-file to ff, then you can open a file in emacs with ff file:
alias ff 'find-file $1'
Map dired to d:
alias d 'dired $1'
Resources: Mastering Eshell
http://www.masteringemacs.org/article/complete-guide-mastering-eshell