Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Use ls > filelist and change file list content to file list

I need to use the ls > filelist and, however when is use "cat filelist" it displays all the content in the filelist with filelist as one of the names in it, but i need to change it " * * File List * * ". I am unsure how to do this only to the filelist in file list if that makes sense.
by

1 Answer

Bharatgxwzm
ls > /tmp/filelist
echo " * * File List * * "
cat /tmp/filelist

assumes you are not listing the files in /tmp. If that is the case change the /tmp to /var/tmp

Login / Signup to Answer the Question.