Linux Find Command Task Failed - Surprising

Can you please point out what I might have missed or what I may be interpreting incorrectly?

Please review question in attached screenshot (Linux_Find_Command_1.jpeg).

I connected and don’t find any ‘.js’ files in /var/www/html/official. I didn’t check any sub-directory though.

I used the following command (and didn’t get any error related to permission denied or anything else):

find /var/www/html/official -name ‘*.js’ -exec cp --parents {} /official ;

Next, I changed the directory to /official (not /var/www/html/official) and did ls there and get the next prompt without any listing of any files or sub-directories (review attached Linux_Find_Command_2.jpeg).

When I didn’t find any .js file in /var/www/html/official, I kind of expected that nothing will be copied to /official. This is one of the possible outcomes..

Anyhow, the task was marked failed. Can you please advise of the shortcomings?

Are you sure it worked at that time? Actually I am getting error.

Somehow, the command in the post got altered.

Correct command I used is below:

Yeah, It’s working. But actual reason is you not found ‘.js’ file in the above directory. Did you try to see manually or ran command like find official/ -name '*.js' -type f.

Manually, using ‘ls’

Anyway, if the command worked for you, why not for me? That’s all I did as root user, but, nothing got copied, and no errors were thrown either.

And task got failed.

ls command will only list the current directory files, Have you tried tree command or went inside another directory to inspect “*.js” files? If you did already then wait for the KKE team. They will look into it. But I haven’t seen this kind of case in the past. Files should be there what is mentioned in the question.


No, I haven’t. Hoping to hear from Team KKE @Inderpreet @mmumshad for reason for the failed task.

@arjitn Hey dude, I had the same task, it has been completed successfully, I can say the task and its environment works fine, I believe you have missed something

@Nasri Is there anything else to do in the task, other than running this command?

Any update Team KKE? @mmumshad @Inderpreet @Ayman @kodekloud-support3

sudo find /var/www/html/media -type f -name ‘*.php’ -exec cp --parents {} /media ;

media being the new file location.

This worked fine