Trying to list files/folders WITHOUT a specific directory
I'm trying to get a file and directory listing for a web site I inherited. I opened a Windows command prompt (I'm using Windows 7) and entered the following command: dir /o:gn /s > filename.txt.
For the most part, it does what I wa开发者_Go百科nt. HOWEVER, it also includes the annoying _notes directories that DreamWeaver leaves behind -- which I DON'T want!!!!!!!
I have to slog through thousands of files and directories, and I could care less about the _notes directories (or anything in them). Editing my results is going to take way too long, and I don't have time to do that.
Is there any way to supress specific files/directories from a DIR command?
Personally, I'd just do it like this:
for /R %f in (*) do @echo %f >> allfiles.txt
grep -v \\_notes\\ allfiles.txt > files.txt
If you don't have grep
then you should get it and learn how to use it. I recommend the version from GnuWin32.
Alternatively, when you export the list of files use a vim macro to remove the directories you do not want. Something like (I did not test this): qq/_notes^Mddq@q
note: replace ^M with the Enter key
精彩评论