I am a self confessed Command Line Junkie. Here are a few tricks I use commonly that I can think off the top of my head.
1. Find a file on your hard disk - (This beats the Search doggie in Windows)
dir filename /s
2. Find a file on your hard disk without all the directory info goo -
dir filename /s/b
3. Create a list of files, say your MP3s to share with a friend? (disclaimer: don't do this piracy crap)
dir *.mp3 /b > filelist.txt
3. Find a directory -
dir dirname /s /ad
4. Move between directories easily
C:\Documents and Settings\Sahil Malik>pushd .
C:\Documents and Settings\Sahil Malik>cd \
C:\>popd
C:\Documents and Settings\Sahil Malik>
5. A better prompt for PushD and PopD via Craig Andrea.
6. Hit Tab for directory/filename compleition
7. Press F7 for a previous command list. User Cursor keys to select the command you need.
8. View all environment variables
SET
9. View only system variables that start with W
Set W
10. View a particular env. variable
ECHO %WINDIR%
11. Find what process has opened what port
netstat -noa
12. Widen your command prompt.
mode 120,100
13. View your TCP/IP settings.
netsh interface ip show config
14. Weird looking colors
color 8f
15. Find a string in a list of files, for example "Foo" in all .cs files in your project tree:
findstr /i /s "foo" *.cs
(You might know that the windows search doggie does an awful job at search thru files, I think it just ignores files with recognized extensions, so .cs will be ignored YUK).
16. refresh the netbios nametables:
nbtstat -R
On
8/5/2006 11:13:59 AM
SRK
said ..
Very useful mate !
|
On
11/21/2006 2:59:17 PM
Mike P
said ..
In another discussion at the site , you made the following comment:
p{color:black;} I am a self confessed Command Line Junkie. Here are a few tricks I use commonly that I can think off the top of my head. 1. Find a file on your hard disk - (This beats the Search doggie in ...
Can you tell me what you mean by "p{color:black;}"? I'd really like to have a different color for my prompt (and only the prompt), but I haven't been able to figure it out. I'm wondering if this might be a solution, although I'm not clear on how/where to insert that syntax.
Thanks, Mike
|
On
11/21/2006 3:00:16 PM
Mike P
said ..
I forgot to add the link to the other discussion. Here it is:
http://pluralsight.com/blogs/craig/archive/2005/01/12/4923.aspx
|
On
11/22/2006 1:46:12 PM
Sahil Malik
said ..
Mike - I'm not sure if I understand your Q.
|
On
5/12/2008 11:30:38 AM
Tikoro
said ..
Mike: the p{color:black} was a piece of CSS that was not put in the right place to be interpreted by your browser. It is not DOS syntax..it is used to styling the output display of a webpage.
|
On
9/15/2008 5:07:15 PM
Dennis
said ..
Very very cool... just what I needed, thanks!
|
On
12/9/2008 8:21:43 PM
Anonymous
said ..
Pfft. DOS isn't a command line, it's a children's toy. Ever try BASH? ZSH? You Windows sufferers are so clueless about the alternatives. You can't even do that many nifty tricks with the Windows command line.
|
On
12/25/2008 1:35:42 AM
SomeDude
said ..
DOS is for pansies
Bash, Cshell those are command lines
DOS is like the retarded offspring of an 4th generation alabama cousin couple
wait wat
|
On
3/4/2010 10:22:04 PM
Why Anonymous?
said ..
Quote: "Pfft. DOS isn't a command line, it's a children's toy. Ever try BASH? ZSH? You Windows sufferers are so clueless about the alternatives. You can't even do that many nifty tricks with the Windows command line."
Oooh I'm ace, I've tried Bash, whooptie fuc***g doo!
There is always going to be beginners. Windows is still very common so some tips and tricks are always welcome, especially with the command line, as it is already built in, so you don't need to install any extra tools if you know how to use it. Some of these tips on here are pretty good so thank you! And there is plenty you can do with CMD. Why did you come on here and say that "Anonymous"? Does it give you a boner? Make you feel adequate?
I know this is an old thread, sorry but I hate twats like that, there was no need for it.
|
On
3/10/2010 8:03:21 PM
goviraja
said ..
WOW great tricks!!. mode 120,100 this is most useful to me as its needed for working with command line sqlplus or mysql databases with wide screen.
|
On
7/5/2010 5:16:04 PM
a guy
said ..
the one that widens the screen is great because in windows vista you cant make cmd full screen but with that code you can
|
On
8/11/2010 2:16:51 PM
Henry Navin
said ..
Exactly what DOS would I use to find string X on flash drive Y and redirect only the file names to txt file Z
Please reply by email.
Thank you.
|