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


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'; 
    echo -e '\033[00m'
  • MANY THKS!! , that's it !! works as expected. – vladimir pavloski May 9 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.