What is the command to find a jar file in a particular folder?
Say I want to find log4j.jar
in the /dev directory, what command should I use?
findlinux
What is the command to find a jar file in a particular folder?
Say I want to find log4j.jar
in the /dev directory, what command should I use?
Best Answer
You can use
find
. In your case:You can also use wildcards, for example
would find all
.jar
files under/dev
.Note that find does the search resursively, i.e. searches all subfolders of
/dev
, too. You can adjust the maximal depth of your search using the-maxdepth
parameter, seeman find
for more details.Note also that in your case you should perhaps have
root
permissions because not all subfolders in/dev
are readable by all users. In a debian/ubuntu system you could just add asudo
before thefind
command.If you don't want to search resursively you could just use
ls
for examplewill list all
jar
files under/dev
.