#1
|
||||
|
||||
Command promt question
Hello, first of all this is a home work question! and i have researched it but there seems to be alot of answers so I am confused even though it seems like a simple question!...
Q. In a command, what is the purpose of the redirection symbol? (>) My A. It used to send the output from a command? Is this correct? Cheers |
#2
|
||||
|
||||
Hi rocky6 and welcome. I dont usually help with homework questions however it does look like you have tried to research the question yourself so I will make an exception this time.
You are on the right track. That particular redirector will send the output of a command to a file that you specify. The file will be created if it doesnt exist or overwritten if it does. I use it a lot - see a simple example below: dir /s /a "c:\normal.dot" > c:\find.txt The above command searches the C drive and sub directories for all files named "normal.dot" and sends the output (result of the search) to a text file on the C drive named find.txt. |
#3
|
||||
|
||||
Thank you so much AnnMarie. You have made it clear to me and yes alot of research I did do on this. So thank you again, I understand now
|
#4
|
|||
|
|||
Also, if I may, and even for my recall of dos commands, the letter "a" limits the search result to only files with the "a" attribute attached. Eliminating the "a" switch would theoretically expand the search to all files, even though the "a" is usually attached to most files. Is this an accurate statement?
|
#5
|
||||
|
||||
You are welcome rocky6.
Hi Jj4cL. Not quite. Using the /a switch alone displays all the files (including system and hidden) and sub directories (but not the files or folders within any sub directories) however it can be used to limit the search to files with certain attributes as you have suggested. For example: cd\ && dir /a:a > c:\find.txt The above command will find every file in the root directory with the archive bit set ("a" attribute). The double ampersand is a special type of command separator and allows you to string multiple commands together on a single line. |
Bookmarks |
«
Previous Topic
|
Next Topic
»
Topic Tools | |
|
|
Similar Topics | ||||
Topic | Topic Starter | Forum | Replies | Last Post |
System restore from the command promt | Jimmy9369 | Windows XP | 3 | October 13th, 2008 10:50 PM |
Command Promt Exits When "Enter" Is Pressed | Blueback00 | Windows XP | 0 | July 8th, 2008 08:49 PM |
Help with Command Promt | kelly1897 | Windows XP | 9 | August 10th, 2007 12:44 AM |
Command Promt Error | ccbling | Malware Removal | 3 | March 28th, 2006 10:12 AM |
My command promt wont work | ninjaval | Windows NT, 2000, 2003, 2008, 2012 | 2 | April 8th, 2003 06:43 AM |
All times are GMT +1. The time now is 10:29 AM.