Talk:Command Prompt: Difference between revisions
m New section: Redirection |
mNo edit summary |
||
| Line 38: | Line 38: | ||
But, how pedantic do we want to be? Feel free to ignore and thanks for added this very helpful section! [[User:Spike|Spike]] 07:40, 10 April 2009 (EDT) | But, how pedantic do we want to be? Feel free to ignore and thanks for added this very helpful section! [[User:Spike|Spike]] 07:40, 10 April 2009 (EDT) | ||
: It's been almost a decade since I've had to use any of this, so the terminology has eluded me a bit. I was also trying to remember how to fit CON into there somewhere to dump stuff you type in right into a file... then realized I'd completely forgotten how that works! Will have to reword the section when I next log on. Might do something about adding the copy/move/delete section before it too - and cover the use of wildcards. -[[User:NKF|NKF]] 10:08, 10 April 2009 (EDT) | |||
Revision as of 14:08, 10 April 2009
Bomb Bloke,
I just remember something, and I had to point it out. You can't change directories with cd/chdir.
Typing in the disk name after cd will only show you the current directory of that volume. Say you were in your cd-rom and you've cd'd your way into a directory, then switched back to the C: drive. Typing cd d: will only show you the current directory you were in on the d: drive - and any actions you provide and pass the D: parameter without the slashes or directory names will happen in the directory you were working in.
Switching between disk drives is easier. Just enter the volume name and bam, there you go.
I'm trying to think of how to fit the parameters. This would be a good way to lean in to explaining how to set the path parameter. Would also be a good place to explain prompt and the ever useful dircmd settings.
I think there are lot of macros like %path% that I wish I had a list of. They're pretty handy. I know you can automatically fill any of the parameters (which you can see with SET) into something else by just surrounding the name in % symbols. So you can type something like echo %path% and it'll display your path.
- NKF
Gah, you're right about changing drives - I've been using the command for so many years that I forgot what it was (my fingers type on auto-pilot, you'll notice that in my example graphic I did it correctly)!
Feel free to edit any of my text as you wish, especially if you spot any silly errors like that. I got a bit long-winded about the CD command, and probably just ended up causing confusion.
Redirection
I thought piping was something to do with putting icing on cakes? :)
More seriously, but very pedantically, IMO what the excellent section on Piping is discussing should properly be called 'Redirection', of which 'Piping' is one particular kind. Piping is when the input stream flows into another executable and is consumed as its input, indicated by the pipe symbol. Maybe you could also consider reading command input from a file by "executable < datafile" as piping, but this could go either way. The rest is plain old file redirection.
So in summary:
- Redirection
- File Redirection
- < Input redirection
- > Output redirection
- Piping between executables
- | Pipe
- File Redirection
But, how pedantic do we want to be? Feel free to ignore and thanks for added this very helpful section! Spike 07:40, 10 April 2009 (EDT)
- It's been almost a decade since I've had to use any of this, so the terminology has eluded me a bit. I was also trying to remember how to fit CON into there somewhere to dump stuff you type in right into a file... then realized I'd completely forgotten how that works! Will have to reword the section when I next log on. Might do something about adding the copy/move/delete section before it too - and cover the use of wildcards. -NKF 10:08, 10 April 2009 (EDT)