I'm using the command
ls -a | grep '^\.'
for showing only the hidden files.
I added the line
alias hidden='ls -a | grep '^\.'' # show only hidden files
to .bash_aliases
file
but this does not work. It's probably the problem with '
character.
Could you please help me write the correct alias?
Best Answer
Either make the inner pair of quotes double quotes:
Or make the outer pair of quotes double quotes:
Or make all quotes double quotes and escape the inner pair:
Or make it a function, so you can pass some arguments when calling: