Search code examples
linuxspecial-characterswildcardbackticks

How do you use wildcards or any other special character in quotes, single quotes or backtick?


How do you use wildcards or any other special character in quotes, single quotes or backtick?

and

How do you make it so Linux doesn't take it literally? For example

echo "This is my list of file ls -l"

I know their is another way of doing it for example

echo "This is my list of file" ; ls -l

But I'm trying to keep the ls -l inside the echo.


Solution

  • You could use:

    echo "This is my list of file $(ls -l)"
    

    This will print the output of ls -l inside the echo statement.