Bash Help

Discussion in 'Programming' started by Mark Neil, May 17, 2015.

  1. Mark Neil

    Mark Neil New Member

    Joined:
    May 17, 2015
    Messages:
    2
    Likes Received:
    0
    I'm a little new to bash programming and using Terminal, so I need help with something. Is there a way to check if there are any external drives through a command? I don't necessarily want any information on the drive; I would prefer the command gave me a simple yes, there are external drives connected, or no, there aren't any. Thanks, and sorry for the non-technical language.
     
    Mark Neil, May 17, 2015
    #1
    1. Advertisements

  2. Mark Neil

    Cory Cooper Moderator

    Joined:
    May 19, 2004
    Messages:
    5,565
    Likes Received:
    174
    Hello and welcome.

    There isn't a command that gives a simple yes or no. However, you can see what volumes are currently mounted in Terminal by issuing the following command:

    diskutil list

    It will show all mounted volumes, their partitions, and other information. disk0 is your boot volume, usually your internal, if that is where OS X resides.

    C
     
    Cory Cooper, May 17, 2015
    #2
    Mark Neil likes this.
    1. Advertisements

  3. Mark Neil

    Mark Neil New Member

    Joined:
    May 17, 2015
    Messages:
    2
    Likes Received:
    0
    Awesome. Thanks so much!
     
    Mark Neil, May 17, 2015
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.