Mac Terminal Commands not working

A few months ago, I discovered the awesome Terminal App on my Mac and came to know of its great uses. But since yesterday, when I enter any command into Terminal, I get this response:
-bash: $: command not found
while all the commands I enter worked before! How to solve this problem?

You're entering a command that starts with '$' by itself. That's a syntax error. It's hardly possible to overstate the danger of using the shell if you don't have a basic understanding of it.

Similar Messages

  • Basic Terminal Commands Not Working

    I'm having trouble using basic commands in terminal that I've been able to use in the past. For example, if I type "dir," I get "-bash: dir: No such file or directory"
    I'm know sure what "bash" is, or if that has anything to do with it.
    I'm also trying to use the tar command, which I've not used before. Again, I get a similar error: "-bash: tar: No such file or directory"
    Hope you can help. Thanks!

    Here is an overview of the terminal commands.  Lets assume that your account has a short user name of mac.
    Macintosh-HD -> Applications -> Utilities -> Terminal
    #What is my short user name?  Type the whoami command.
    mac $ whoami
    mac
    mac $
    #How to list all of your disks.
    # The ls command is for list
    mac $ ls /Volumes/
    Audio CD       Macintosh-HD   Spotless       Tiger-ext
    mac $
      # Let's say your flash drive is named Spotless
    # cd is change directory
    mac $ cd /Volumes/Spotless
    # pwd is print working directory
    mac $ pwd
    /Volumes/Spotless
    mac $
      # The ls command is for list # l is long # F is type of file where / is directory mac $ ls -lF
    total 134704
    -rw-r--r--     1 mac  staff     64560 Mar  3  2009 A-picture-of-Youpi-key.png
    drwxr-xr-x    83 mac  staff      2822 Nov  7 14:52 Applescript files/
    drwxrwxrwx    12 mac  staff       408 Dec 13  2008 Christmas Cards/
    drwxr-xr-x     9 mac  staff       306 Dec 21 17:39 Christmas Cards 2009/
    ... trimmed ... What does all this mean?
    drwxrwxrwx
    d = directory
    r = read
    w = write
    x = executeable program
    drwxrwxrwx
    ||  |  |
    ||  |   all other users not in first two types
    ||  | 
    ||  group
    ||
    |owner

    What type of entery is this? d = directory, - = file, etc. 
    Every Unix resource: files, folders, etc has an owner, group, other 
    A Unix resource has one owner.
    A Unix resource has one group.  A group contains a list of users.
    To gain access to a file.  You can be the owner, in the group, or not being the owner or in the group you ended up as other. The owner, group, or other  has read, write, or execute permissions.
    # l is long
    # a is all to show hidden files & folders
    mac $ ls -lFa
    total 134736
    drwxr-xr-x    41 mac   staff      1496 Dec 22 17:11 .
    drwxrwxrwt     8 root  admin       272 Dec 24 13:55 ..
    -rwxrwxrwx     1 mac   staff     15364 Dec 23 12:52 .DS_Store*
    drwx------     4 mac   staff       136 Jan 22  2009 .Spotlight-V100
    drwxrwxrwt     5 mac   staff       170 Sep 14 16:36 .TemporaryItems
    d-wx-wx-wx     4 mac   staff       136 Dec 31  1969 .Trashes
    -rw-r--r--     1 mac  staff     64560 Mar  3  2009 A-picture-of-Youpi-key.png
    drwxr-xr-x    83 mac   staff      2822 Nov  7 14:52 Applescript files
    drwxrwxrwx    12 mac   staff       408 Dec 13  2008 Christmas Cards
    drwxr-xr-x     9 mac   staff       306 Dec 21 17:39 Christmas Cards 2009
    ... trimmed ...
    # mv is move or rename
    mv -i the-name the-new-name
    # You can just rename the file back to what it was with mv command.
    mv -i old-name new-name
    Here is what these commands mean:
    cd is change directory
    pwd is a print working directory
    ls is list
    sudo is Super user do
    mv is move or rename
    For cryptic comments, you can always uses the manual command which is man. For example:
    man mv 
    # Type the letter q to quit.
    In case you have spaces in your filenames or directories, you need to escape them. See examples: 
    mac $ ls -l ~/"see it"
    -rw-r--r-- 1 mac staff 3171 Oct 26 23:38 /Users/mac/see it
    mac $
    mac $ cd /Users/mac/Desktop/ttt\ html\ copy/
    Do you know about tabing? Type in a few letters of a name then press the tab key. The computer will type out the rest of the name if it is unique.
    Press the up arrow key to see the previous command(s).
    To edit a command, use the left arror key to more left and the right arror key to move right.  Use the delete key to delete the key to the left.  Type a letter to insert.
    history to see many previous commands. 
    mac $ history
        2  man launchd.conf
        3  history
    http://discussions.apple.com/thread.jspa?threadID=2692161&tstart=0 
    Robert

  • Terminal commands not working {clear, pico, etc..}

    After Upgrading to Snow Leopard I am trying to work out of the terminal (using git) and some of the basic commands are not working. Things like trying to use clear and pico to edit files return this error.
    -bash: clear: command not found
    my paths looks like this
    /usr/bin
    /bin
    /usr/sbin
    /sbin
    /usr/local/bin
    Can any one help me out with that? (I am new to the Terminal so putting things in laments terms would be appreciated)
    Thanks for any help!

    when i type the $ls -l `whereis clear pico nano` it gives me the same error,
    -bash: whereis: command not found
    and then it just lists the directory. but is i just do ls -l clear or ls -l pico it gives me responses that look like the ones you have posted...
    ls -l clear
    -rwxr-xr-x 1 root wheel 50768 May 18 2009 clear
    ls -l nano
    -rwxr-xr-x 1 root wheel 324320 May 18 2009 nano
    ls -l pico
    lrwxr-xr-x 1 root wheel 4 Oct 1 15:48 pico -> nano
    is this something where I can just copy the /usr/bin over from a friends computer? (one of my friends bought their computer[same one as mine] about a month after i got mine) or is that a no go? would that actually solve any thing or just cause more problems?

  • Terminal commands not working.

    Hey all, well it seems I've really messed it up. I've ventured into my first experience with database application programming using mySQL and have royally screwed up my Terminal. When I start up Terminal, the second line says: -bash: ps: command not found (the first line just says my last login). And that definitely did not happen before I started messing with it. I cannot do any of the normal commands like cd or ls or anything. I have no idea how to fix this, I've looked around on stack overflow and other sites like it but cannot find a solution that does me any real good.
    I'm on a Retina MacBook Pro running Mavericks. 2.3 GHz Intel Core i7 Processor and 16 gigs of RAM.
    I've tried to find a way to reset my Terminal by going to Library-Preferences-and trying to find that com.apple.Terminal.plist file but for some reason that's not even there. Maybe that's what my problem is? Anyway, any help is appreciated as I would love to get back up and running with database programming asap.
    Thanks.

    Problem solved! I messed with my .profile file and changed the path around a while ago when first starting with all this. I reverted back to the original .profile file and that fixed everything.

  • Captivate 5 for Mac - keyboard commands not working

    I just fired up Captivate 5 for Mac for the first time and am trying to create a recording, but the command+enter key does not stop the recording and instead captures a screenshot. In fact, every command combination I try does that and the only way to stop the recording is to click on the icon in the status bar at the top. What am I doing wrong? I have searched through the forum and help and don't see anyone else having this problem.

    If you're talking about keystroke shortcuts in published browser output, the issue is not Adobe's fault but the fact that browsers get first pick of the keystrokes and assign them to their own browser functions. 
    There is no way to control what the browser will or will not let through from within the Captivate content.  Each end user's browser can have different settings.
    My advice is to stop stressing about using keystrokes.  There are some things that you can achieve when building an application that cannot be replicated exactly when building a browser-based simulation of that same application.

  • Terminal Command not working

    I am trying to run a .sh file to compile/make Slax OS work on a USB stick. I tried this code
    [quote]
    sh ./bootinst.sh
    but it returned with all of this, what does it mean, I am in the mounted flash drive directory
    [quote]
    egrep: /proc/mounts: No such file or directory
    egrep: /proc/mounts: No such file or directory
    egrep: /proc/mounts: No such file or directory
    egrep: /proc/mounts: No such file or directory
    egrep: /proc/mounts: No such file or directory
    Can't find device to install to.
    Make sure you run this script from a mounted device.
    Message was edited by: kmccmk9

    Did you see these?
    http://backtrack.offensive-security.com/index.php?title=Howto:USB_Stick
    http://www.slax.org/forum.php?action=view&parentID=1230

  • AppleShowAllFiles command not working on multiple Macs running 10.6.6

    I needed to restore a Time Machine cookie from a Mac and no matter what I could not display hidden files in finder (Therefore making cookie restoration a severe pain). The commands seem to no longer function properly in 10.6.6. I even tried the older version of the command with "-bool", but to no avail. I've tried on 3 different Macs running 10.6.6 and another running 10.6.6 server and am getting the same results (no change in hidden files after restarting finder). 10.5.8 and 10.6.3 has no problems toggling the hidden files though....
    2 of the Macs had the hidden files already hidden and the third has had hidden files visible since at least 10.6.3 and none of them will change the hidden files from the state they are currently in.
    Here is the command I've been using with out issues until now:
    # sudo defaults write com.apple.Finder AppleShowAllFiles YES
    # sudo killall Finder
    and then here are the other commands I also tried:
    # sudo defaults write com.apple.Finder AppleShowAllFiles TRUE
    # sudo killall Finder
    # sudo defaults write com.apple.Finder AppleShowAllFiles -bool TRUE
    # sudo killall Finder
    I tried running the commands and then restarting with no luck and tried restarting and then running the commands also with no luck. Terminal processes the command the same as it always has, no success or error message.
    I ended up using the "Secrets" pref. pane to be able to get into the hidden files so I could restore the Time Machine cookie but I can't figure out why the terminal command stopped working for me. Is it because of 10.6.6 or am I taking crazy pills? If anyone can duplicate this issue or has seen it before I would be very appreciative as "The Google" does not seem to have the answers I seek.
    Thanks!

    Wow Baltwo that was a fast correction on that applescript syntax, thanks! The applescript worked, but that made me even more frustrated as the applescript is using the same command just with a boolean instead.
    AND THEN, I noticed your comment about sudo not always being necessary. I've never had any ill effects from using too much sudo on linux boxes (excluding security and permissions issues that could arise) and was like "pffff.... sudo never hurt nobody" but that is not the case on mac and/or unix I guess. I dropped the sudo and everything works perfectly.
    So for forum searchers: If "sudo defaults write com.apple.finder AppleShowAllFiles Yes" doesn't work after restarting finder, drop "SUDO" and it will work.
    So thanks again baltwo, and don't worry about the TimeMachine cookies - that part I had no problems with - it's just restoring the local cookie to the network volume so TM can continue using the sparsebundle already there. I just couldn't get to the local cookie because it's hidden!
    As punishment for this problem being so easy to fix I will go let the users assault me with Blackberries and Vista laptops for one hour. Sigh...
    Edit 1 -- Linc Davis answered correctly while I was typing. Thanks Linc Davis as you are absolutely correct. I am a sudo abuser and never thought it was so bad
    Message was edited by: SteveMobs
    Message was edited by: SteveMobs

  • Crontab reboot command not working

    Crontab reboot command not working
    Greetings
    I am new at this so excuse any ignorant mistakes I might be making.
    I have a server (MM X.4.9) that I would like to restart every day in order to make sure no programmes are hanging etc. If a program is hanging is should force quit it. Using terminal I have entered the following command:
    sudo nano /etc/crontab
    Entered password
    Than I entered using tab between each sequence:
    15 13 1 1 * root reboot
    This was a test run and it did not reboot.
    Entering
    cat /etc/crontab
    I got:
    # The periodic and atrun jobs have moved to launchd jobs
    # See /System/Library/LaunchDaemons
    # minute hour mday month wday who command
    15 13 1 1 * root reboot
    What have I done wrong?
    Thanks

    Hehe, there you are experimenting with a "reboot" cron command and you are surprised it quit so fast. You are not going to find a "graceful" solution to shutdown dialogs.
    MSWord is a Java app, so it is especially important for the command to work that it doesn't get hung up on outer layers of the system. Especially stupid apps that use Java which is not well integrated. I believe Word has a 5 minute autosave, so you should be able to recover most of your document.
    This reboot command should be running around 2AM, when the average webserver has minimum traffic. If you feel the need to reboot during busier times of the day, I'd suggest you look at what's causing your applications to crash.

  • Since downloading Yosemite Flash Player not working. Have downloaded Flash Player for Mac, but still not working. Is there a fix for this? Thanks.

    Since downloading Yosemite Flash Player not working. Have downloaded Flash Player for Mac, but still not working. Is there a fix for this? Thanks.

    1. System Preferences >  Flash Player > Advanced >  Delete  All
         Press the "Delete All" button.
         Install Adobe Flash Player.
        http://get.adobe.com/flashplayer/
       Download it first.
       The next step is important.
       Click Safari in the menubar and select “Quit Safari”.
       If it doesn’t quit, Force Quit it.
       Press command + option + esc keys together at the same time. Wait.
       When Force Quit window appears, select the application if not already.
       Press Force Quit button at the bottom of the window. Wait.
       Application will quit.
        Follow the prompts and install it.
        Restart computer. Relaunch Safari.
    2.  Allow  Plug-ins
        Safari > Preferences > Security
        Internet Plug-ins >  "Allow  plug-ins"
        Enable it.

  • Mac App Store not working? (Glitching and flashing!)

    Mac App Store not working? (Glitching and flashing!)
    I was at my friends house, everything was working fine. I went to my girlfriends house, everything was still working fine. Then once I got home, I got back out my 2010 MacBook Pro 15" to use and some pages on the internet looked a little odd. They were all in HTML format and wouldn't go back (Pages such as Skype and Apple's main page). I thought they were just down or being fixed up, but then I went to update my Mac under the App Store. I clicked the App store and a message popped up saying "App Store cannot verify a secure connection with the App Store." The options were "Cancel" or "Continue". I clicked "Continue" so I could update my Mac, but weird enough, the App Store started flickering (strobing; blinking) as seen in this video by someone with the same problem: http://www.youtube.com/watch?v=De8aQZccRvA
    I do not know what to do or why this is happening, so help would be VERY nice.

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Click the Clear Display icon in the toolbar. Then try the action that you're having trouble with again. Select any messages that appear in the Console window. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V).
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.

  • Can anyone suggest me a handbook of mac terminal commands

    Guyz I am new user of mac and I like to use the terminal. Can anyone kindly suggest me any handbook or codebook for learning basic mac terminal commands?

    Spend some time in a book store that has a section of Unix/Linux oriented computer books.  Find a book that discusses the Bash Shell (Bourne Again Shell; in tribute to Bourne, who wrote one of the first shell's to be popular on Unix).  Bash is the default shell for Mac OS X.  Such a book will give you the basics of using the shell.  Most of the commands they will teach you about will work on Mac OS X, although you may run into a few commands that have slightly different options, the basics are still going to be the same.
    Or a book on shell programming.
    Anyway, browse the books and if you find one that "Speaks to You", then buy it.
    There are also some "Mac OS X for Unix Geeks" books available that might give some Mac OS X specific Unix usage, but they also may assume a lot of existing command line knowledge.
    The key think to keep in mind, is that 85% to 90% of the Mac OS X command line interface is just like every other Unix/Linux command line interface.  Of course that last 10 - 15% can trip you up, and relates to specific commands and command options that may vary between Unix/Linux implementations.  That being said, a lot of knowledge about another Unix/Linux platform is transferable to the Mac OS X command line.

  • HT1203 i have tried this 6+ times to "How to share music between different accounts on a single computer" on my wifes mac and can not get it to work!! On my PC no problem but on the MAC it will not work, follow the instructions to the T but no go????

    i have tried this 6+ times to "How to share music between different accounts on a single computer" on my wifes mac and can not get it to work!! On my PC no problem but on the MAC it will not work, follow the instructions to the T but no go????

    It is almost as if the program does not exist on my computer. If I search for it, the only thing that comes up is the installer. I cannot find it anywhere despite the fact I have installed it numerous times, uninstalled it and conducted a fresh install, and the Adobe website checks says that it is installed.

  • My mac book is not working so i can no longer use my mac to back up my note in my phone and unfortunately i dont have outlook on my pc is there a way to get all my old notes from my 3gs to my 4s iphone?

    my mac book is not working so i can no longer use my mac to back up my note in my phone and unfortunately i dont have outlook on my pc is there a way to get all my old notes from my 3gs to my 4s iphone?

    Reset, hold both home and power buttons until the iPhone begins to start, try this a few times if necessary. If still problem, you may have to just Restore your iPhone to get it working. In the future sync your iPhone with iTunes routinely and when it contains important data, iCloud when set correctly will do this for you continuously.

  • Alt ctrl c shortcut command not working in photoshop cc, it is opening Internet explorer (IE)

    In Photoshop CC 2014  Alt + Ctrl + C ( to open for canvas size dialog box ) command not working, it is opening Internet Explorer (IE)

    What version of windows are you using?
    See if the Internet Explorer shortcut has that keyboard shortcut assigned to it.

  • Bash commands not working after upgrade to Lion

    After upgrade, many BASH commands not working. For example, such a fundamental thing as "ls". 
    iMac20:bin a$ ls
    Launch of "ls" failed: the PowerPC architecture is no longer supported.
    What does it have to do with PowerPC? My computer is 2.66 GHz Inter Core Duo

    Linc,
    iMac20:~ a$ which ls
    /sw/bin/ls
    Also, I managed to look (using tcsh's ls-F command) into the contents of /usr/. Here's what I see there:
    [iMac20:/bin] a% ls-F
    [*          csh*        echo*       ksh*        mkdir*      rcp*        stty*       wait4path*
    bash*       date*       ed*         launchctl*  mv*         rm*         sync*       zsh*
    cat*        dd*         expr*       link*       pax*        rmdir*      tcsh*      
    chmod*      df*         hostname*   ln*         ps*         sh*         test*      
    cp*         domainname* kill*       ls*         pwd*        sleep*      unlink*    

Maybe you are looking for

  • I want the Google and Yahoo fight on my browser to go away. How do I get rid of these stupid notifications asking me to make one or the other my defaults?

    I use Google. My browser is set with Google.ca as my homepage and Google is my default search engine. For a while I was getting messages asking me if I wanted to know how to make Yahoo my defaults...I managed to get rid of that crap... But now I get

  • Using Spaces for task separation?

    I was hunting around on the internet to try to find a way to have tasks separated in spaces rather than applications. I came across an article that said with the new 10.5.5 update this should be possible. The article said I just had to uncheck the bo

  • Setting a Filter on a dynamically created Table

    Hi All, I am currently working on a Database to automatize some process. Quick explanation: The User can import a CSV (Text) File via a DialogBox, which gets imported into a Table. After this, the content has to be filtered, setting conditions on 4 d

  • Change of ownership

    2 months ago after numerous calls and multiple different explanations we were told that our one bill account was changed to my wifes name. Now not only is the account not in my wifes name but the one bill account is gone and everything is billed sepa

  • Problem updating sales order partner addresses

    Hi all, iam trying to update addresses on sales order if there is any update on on the delivery. I update the VBPA-ADRNR and create the same ADRC-ADRNR. but when iam updating VBAP-VBELN for order using BAPI_SALESORDER_CHANGE there is a new ADRNR bein