Bloody Computer

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Tuesday, 22 September 2009

By Your Command: A Rough Guide to the Command Prompt, Part 2

Posted on 08:40 by Unknown
In a previous post I explained how to navigate to different drives and folders using Command Prompt. I also showed how to list the contents of the current folder using the dir command. We will now look a little closer at this command.

In the tutorial, I suggested typing the following command dir /a-d /b > filelist.txt. We shall not worry about the > filelist.txt part for now, but rather look at the anatomy of the dir command itself to serve as an example of how Command Prompt works.

Following the dir command there are two switches: /a-d and /b. These switches alter the way in which the command works. In this case they adjust what folder contents is listed and how it is presented: /a-d stops the dir command from listing folders; /b prevents the command from showing the extra information you see if you just type dir and hit Return.

You can list all the switches associated with dir by entering dir /? in the Command Prompt. The /? switch provides help for any command it follows. In the case of dir it returns something like this:

This may be a little forbidding for the novice; so, I will give another example of switches in action. If you wanted to list all the folders (or directories as they are known in Command Prompt) at the top level of your D:/ drive you would enter -

dir d: /ad
[Note that switches are not case sensitive]

If you wanted to also list all the sub-folders, you would enter -

dir d: /ad /s

You may notice how all the information scrolls past really quickly. To pause after each page of information you can use the /p switch. Thus, the command becomes -

dir d: /ad /s /p

To list all the mp3 files on drive D: pausing after each page use the following command -

dir d:\*.mp3 /s /p

The asterisk is a wildcard. In other words. it means 'any combination of letters'. So if you wanted to list all the mp3 files with the word 'Beatles' in the filename you would use -

dir d:\*beatles*.mp3 /s /p

The dir command is a good way of having a play with the command prompt safe in the knowledge that you will do no harm to your files. If you have any questions about this command feel free to leave a comment and I will do my best to address them. More commands next time.
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Posted in Command Prompt | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Keyboard shortcut of the week: undo and redo
    Just about every windows application has an 'undo' feature and most have a 'redo' feature. These are a lifesaver on those fr...
  • How to show unread messages in Gmail
    Apologies for not posting in a while. I thought that I would share this short and sweet post for those who want to list only unread messages...
  • Recovering text from Word documents (Part 1)
    If Microsoft Word runs into a problem with a file it usually offers a recover option when you open the program the next time. But sometimes...
  • Toolbars gone AWOL
    There is a bug in Windows XP that causes the toolbars in Internet Explorer and Windows Explorer (the thing that opens when you double-click ...
  • Keyboard shortcut of the week: The Case of MS Word
    When using a word processor it is quite common to forget that that the CapsLock key has been left on, or you might decide that a piece of t...
  • How to reboot Windows using the keyboard
    I was writing a post on how to reinstall the mouse using the keyboard when I realised that rebooting the PC using the keyboard would be a re...
  • Weekend Website: PortableApps.com
    I have not run this feature in ages, but I decided to bring it out of retirement to feature an excellent site: PortableApps.com . With the i...
  • Bring files back from the dead
    Even after you have deleted a file, and emptied the Recycle Bin, you may still be able to recover the file. This is because the data in the ...
  • Windows Folder Options Explained (Part 3)
    Continued from part 2... View Settings continued Hide protected operating system files (Recommended) This option is selected by default, to ...
  • Customising the Quick Access Toolbar
    In a recent post about adding buttons to the toolbars in Microsoft Office applications I pointed out that there is no way to add buttons t...

Categories

  • Audio
  • Backups
  • Blog Carnival
  • Blogging
  • CD-roms
  • Chrome
  • Command Prompt
  • Competition
  • Drives
  • DVD-roms
  • Email
  • Error Messages
  • Excel
  • Faster Windows
  • File Conversion
  • File Management
  • File Recovery
  • File Types
  • Firefox
  • Fonts
  • Freeware
  • Games
  • Graphics
  • Guest article
  • Internet Explorer
  • Jargon
  • Keyboard shortcut
  • LibreOffice
  • Linux
  • Lost document
  • Low drive space
  • Mouse
  • Networking
  • OpenOffice
  • PowerPoint
  • Printing
  • Protection
  • Purchases
  • Registry
  • Review
  • Scanning
  • Searching
  • Security
  • Startup
  • Upgrades
  • Video
  • Web feeds
  • Websites
  • Windows Crash
  • Windows Explained
  • Windows GUI
  • Windows Hangs
  • Word Processing

Blog Archive

  • ►  2012 (4)
    • ►  September (1)
    • ►  May (1)
    • ►  February (2)
  • ►  2011 (12)
    • ►  November (1)
    • ►  October (1)
    • ►  September (1)
    • ►  June (1)
    • ►  May (1)
    • ►  April (1)
    • ►  March (2)
    • ►  February (2)
    • ►  January (2)
  • ►  2010 (21)
    • ►  December (2)
    • ►  October (2)
    • ►  September (1)
    • ►  August (2)
    • ►  July (1)
    • ►  May (2)
    • ►  March (6)
    • ►  February (4)
    • ►  January (1)
  • ▼  2009 (33)
    • ►  December (1)
    • ►  November (1)
    • ►  October (3)
    • ▼  September (4)
      • The 21st Carnival of Computer Help and Advice
      • By Your Command: A Rough Guide to the Command Prom...
      • By Your Command: A Rough Guide to the Command Prom...
      • Spam comments
    • ►  August (1)
    • ►  July (2)
    • ►  June (4)
    • ►  May (3)
    • ►  April (3)
    • ►  March (3)
    • ►  February (4)
    • ►  January (4)
  • ►  2008 (82)
    • ►  December (2)
    • ►  November (4)
    • ►  October (3)
    • ►  September (5)
    • ►  August (4)
    • ►  July (4)
    • ►  June (6)
    • ►  May (7)
    • ►  April (10)
    • ►  March (10)
    • ►  February (14)
    • ►  January (13)
  • ►  2007 (47)
    • ►  December (5)
    • ►  November (6)
    • ►  October (16)
    • ►  September (12)
    • ►  August (8)
Powered by Blogger.

About Me

Unknown
View my complete profile