1

When I type in xfce4-terminal the command:

ls -pltrh --color=always --time-style="+%d-%b-%Y $newline%H:%M" | grep --color=never -v / | cut -d ' ' -f6- 
echo -e -n '\033[1;5;36m'"Diretório §⮕ " 
echo -e -n '\033[1;5;33m'
pwd
echo -e '\033[00m'

it works flawless, but I couldn't succeed to set an alias in ~/.bashrc, it gives an error regarding to | cut -d ' ' -f6- part of the command (alias not found).

How can I fix that? Or should I change completely this command?

OS: Xubuntu 16.04.6

Pablo Bianchi
  • 15,657

1 Answers1

2

To quote the Bash reference:

Aliases allow a string to be substituted for a word when it is used as the first word of a simple command

So this is meant for rather simple cases. You can define this as a function in .bashrc:

function showdir {
    ls -pltrh --color=always --time-style="+%d-%b-%Y $newline%H:%M" | grep --color=never -v / | cut -d ' ' -f6- ;
    echo -e -n '\033[1;5;36m'"Diretório §⮕ " ;
    echo -e -n '\033[1;5;33m'; 
    pwd;
    echo -e '\033[00m'
}
xenoid
  • 5,504