INTRODUCTION TO WINDOWS COMMAND LINE - User4 has a lot of files and folders in their Documents folder. The flag can be found within one of them

I’ve been stuck with this question for days, I’ve tried the tree and the dir /s, the files appear empty

the question is :

User4 has a lot of files and folders in their Documents folder. The flag can be found within one of them.

thanks

try to filter the flag.txt by the size and you will get it

I would say to anyone else coming to this thread looking for answers is to consider the options you have for listing all these hidden files/directories and then consider the parameters you can apply to filter out the duplicates/false flags

Hey bro, so i got the answer on this way:
1: I change from CMD to PS
2 Filter all objects with the .txt extension and concatenate to Sort-Object to filter all files:

PS C:\Users\user4\Documents> Get-ChildItem -Path C:\Users\user4\Documents\ -Filter "*.txt" -Recurse -File | Sort-Object -Property LastWriteTime

3: Once you got the path you can move to the directory and use “type” or “more” to read the file

type flag.txt

I wish i can help because i was like 30min finding the way.
:slight_smile:

2 Likes

Thank you so much for this. I literally spent the better part of a half hour in cmd piping my results into find only to have it keep producing a list of the recursive files from the where command. I was literally about to bounce in to PS to figure this out. You script saved me a hot minute thank you.