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

  • Recent freeware releases
    It has been some time since I last posted on this blog. In that time there have been a number of major new software releases. These include ...
  • 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...
  • Updates
    Apologies for not posting anything recently. I have been very busy with the start of the new university year. Since things have calmed down ...
  • Tips for searching using Google
    The Google search engine syntax offers a number of options for getting better results. You can search for a specific phrase, search only on...
  • 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...
  • What is that character called?
    If you look around your keyboard, you will notice a number of keys with characters on that you may not know the name of. In this post I will...
  • How to compress images in Word and Powerpoint
    Inserted images in Word and Powerpoint may appear small, but they are actually stored as their original size unless compressed. This can cau...
  • Where have all my desktop icons gone?
    Windows offers the facility to hide all the icons on your desktop. The default option is to show all desktop icons, but this may be switched...
  • Dropbox: Internet File Storage
    There are a number of sites that offer you storage space to back up or share your files over the Internet. Many of them have a limit on the ...
  • How to install Ubuntu - Nixie Pixel
    This video is a short beginners guide to installing Ubuntu by Nixie Pixel, who you will see is far from the stereotypical computer geek. Thi...

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