I am in a bash script and I want to get the list of all files (let say all jar files). I execute the command
ls -1 lib/*.jar and I get the output:
lib/mylib_1.jar lib/mylib_2.jar ...
Is there any option to have the following output:
mylib_1.jar mylib_2.jar ...
cd lib before is not an option as I am in a loop and need to be in the parent folder for the actions I want to do inside the loop.
I tried to find information by typing
man ls but I did not find any solution.
A solution with another command would be good as long I can pipe it to my
ls command or self sufficient.