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

Similar Messages

  • 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.

  • 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.

  • 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

  • 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.

  • 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

  • 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*    

  • Why is my BDC_CURSOR command not working to position the cursor?

    Why is my BDC_CURSOR command not working to position the cursor?  Here are the details regarding my issue.
    I am writing a BDC to mass delete routing material assignments using transaction CA02.  I am OK to navigate through the initial screen to go to the Header screen and from here I am OK to navigate to the Material Assignments screen.  But once here, I cannot get the BDC_CURSOR command to take me into the list.  Here are the commands I am using.  Please let me know what I may try differently.
    CA02 Material Assignment - Set position  <-- this resets list of materials to correct position
      PERFORM bdc_dynpro      USING 'SAPLCZDI'   '1010'.
      PERFORM bdc_field       USING 'BDC_CURSOR'  'RC27X-ENTRY_ACT'.
      PERFORM bdc_field       USING 'BDC_OKCODE'   '=ENT1'.
      PERFORM bdc_field       USING 'RC27X-ENTRY_ACT'  c_position.
    CA02 Material Assignment - Delete
      PERFORM bdc_dynpro      USING 'SAPLCZDI'   '1010'.
      PERFORM bdc_field       USING 'BDC_CURSOR'  'MAPL-MATNR(01)'.    <-- this is not working to set the cursor into the list
      PERFORM bdc_field       USING 'BDC_OKCODE'  '=LOE'.             " trash can
      PERFORM bdc_field       USING 'RC27X-ENTRY_ACT'  c_position.
    CA02 Material Assignment - Green Check OK
      PERFORM bdc_dynpro      USING 'SAPLCZDI'   '1010'.
      PERFORM bdc_field       USING 'BDC_CURSOR'  'RC27X-ENTRY_ACT'.
      PERFORM bdc_field       USING 'BDC_OKCODE'   '=BACK'.            " check mark
      PERFORM bdc_field       USING 'RC27X-ENTRY_ACT'  c_position.

    Thank you for your reply.
    I had used SM35 to record.  However, I was not aware of the "create program" feature.  I had commented out a section from my previous post which I have now added back (latest code below).  But it still did not resolve the issue.
    When I execute with dismode = 'N', I get back error message "No batch input data for screen SAPLCZDI 1010".
    When I execute with dismode = 'E' (only show dynpros when error), it stops at the material selection screen without placing my cursor in the list.  I can then MANUALLY click to set the cursor position in the list, MANUALLY click the trashcan, it then uses my BDC command to respond to the popup asking "Do you want to delete", still leaving me at the material selection screen.  I can then MANUALLY click the green check (or enter), then it continues with the BDC to go back to the previous screen, and saves.  But it still will not place my cursor in the material selection list (SAPLCZDI screen 1010).
    Here is code used.  It is the second section of code labeled "CA02 Material Assignment - Delete" that is not working.
    CA02 Material Assignment - Set position
    this code functions to position the desired material to first in screen list
      PERFORM bdc_dynpro      USING 'SAPLCZDI' '1010'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'RC27X-ENTRY_ACT'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=ENT1'.
      PERFORM bdc_field       USING 'RC27X-ENTRY_ACT'
                                     c_position.
    CA02 Material Assignment - Delete
      PERFORM bdc_dynpro      USING 'SAPLCZDI' '1010'.
      PERFORM bdc_field       USING 'BDC_CURSOR' 
                                    'MAPL-MATNR(01)'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=LOE'.             " trash can
      PERFORM bdc_field       USING 'RC27X-ENTRY_ACT'
                                     c_position.
    Acknowledge Pop-Up Screen
      PERFORM bdc_dynpro      USING 'SAPLSPO1' '0100'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=YES'.
    CA02 Material Assignment - Green Check OK
      PERFORM bdc_dynpro      USING 'SAPLCZDI' '1010'.
      PERFORM bdc_field       USING 'BDC_CURSOR'
                                    'RC27X-ENTRY_ACT'.
      PERFORM bdc_field       USING 'BDC_OKCODE'
                                    '=BACK'.            " check mark
      PERFORM bdc_field       USING 'RC27X-ENTRY_ACT'
                                     c_position.

  • Odi os command not working with agentservice agent.

    dear all,
    odi os command not working with agentservice agent but with local agent it work fine.. and user is administrator.
    kindly solve it
    Regards
    Naseer

    Hi,
    you referred to oscommand, so are you executing a .bat fille? if yes, where exactly does the .bat file reside, local machine or on network share?
    Also, follow these couple of documents, they may be helpful to you.
    859215.1 and 424703.1
    Regards
    Srikanth

  • Illustrator Short Commands Not Working

    Hi Team,
    My illustrator CS6 short commands have stopped working.
    Any time I try to use any CMD + Key, illustrator will not react.
    This has been on going for a few months, I have tried resetting preferences but nothing has changed.
    If someone could please help.
    Thanks,
    Brandon

    Hi Jacob,
    I have tried resetting preferences and few other options.
    Anytime I press the CMD key the option at the bottom just changes from selection to direct selection, if that helps.
    Should I uninstall and reinstall illustrator?
    I no longer have my access key.
    Thanks,
    Brandon
    Date: Wed, 8 Jan 2014 15:39:58 -0800
    From: [email protected]
    To: [email protected]
    Subject: Illustrator Short Commands Not Working
        Re: Illustrator Short Commands Not Working
        created by Jacob Bugge in Illustrator - View the full discussion
    THS,
    You may try the following (you have tried/done some of them already) and see whether it helps (the following is a general list of things you may try when the issue is not in a specific file; 3) and 4) are specifically aimed at possibly corrupt preferences):
    1) Close down Illy and open again;
    2) Restart the computer (you may do that up to 3 times);
    3) Close down Illy and press CtrlAltShift/CmdOptionShift during startup (easy but irreversible);
    4) Move the folder Other options (follow the link with that name) with Illy closed (more tedious but also more thorough and reversible);
    5) Look through and try out the relevant among the Other options (follow the link with that name, Item 7) is a list of usual suspects among other applications that may disturb and confuse Illy, Item 15) applies to CC, CS6, and maybe CS5);
    Even more seriously, you may:
    6) Uninstall, run the Cleaner Tool (if you have CS3/CS4/CS5/CS6/CC), and reinstall.
      http://www.adobe.com/support/contact/cscleanertool.html
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5994475#5994475
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5994475#5994475
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5994475#5994475. In the Actions box on the right, click the Stop Email Notifications link.
               Start a new discussion in Illustrator at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • Apache bridge & Basic Auth does not work

     

    The WebLogic newsgroups are not the appropriate place to file product defect
    reports.
    I suggest that you file a bug report with our support organization. Be sure
    to include a complete test case. They will also need information from
    you -- please review our external support procedures:
    http://www.beasys.com/support/index.html
    Thanks,
    Michael
    Michael Girdley
    Product Manager, WebLogic Server & Express
    BEA Systems Inc
    Jaroslav Mechacek <[email protected]> wrote in message
    news:[email protected]..
    >
    I tried mod_wl with apache 1.3.12 ( mod_ssl / openssl ) ,
    but the basic auth does not work.
    When apache starts it complains that mod_lw uses plain apache api
    Tue May 16 17:29:54 2000] [warn] Loaded DSO libexec/mod_wl.so uses plain
    Apache 1.3 API, this module might crash under EAPI! (please recompile it
    with -DEAPI)
    When I request protected page, apache returns both
    HTTP/1.1 200 OK , HTTP/1.1 401 Unauthorized
    what apache / ssl configurations are known to work ?
    Escape character is '^]'.
    GET /file/index.html HTTP1.0
    HTTP/1.1 200 OK
    Date: Tue, 16 May 2000 14:47:01 GMT
    Server: Apache/1.3.12 (Unix) mod_ssl/2.6.4 OpenSSL/0.9.5a
    HTTP/1.1 401 Unauthorized xxx:
    www-authenticate: Basic realm="WebLogic Server"
    content-length: 23
    content-type: text/html
    connection: Close
    No credentials supplied

  • Why does default keyboard shortcut for show/hide baseline grid (opt+command+') not work?

    Why does default keyboard shortcut for show/hide baseline grid (opt+command+') not work?

    Here's where you need to change the settings: System Preferences > Keyboard > Keyboard Shortcuts:

  • Basic commands not working in terminal?

    I have been attempting to set up i2p on my computer, and noticed that terminal responded to any command, no matter how simple, with "Command not found".
    After doing a bit of research across support communities, it seems that my problem lies within my PATH settings, and I need to fix them in order to be able to use commands again. I've tried multiple suggestions seen here on the suppport forums but none have worked so far. When I input /bin/echo $PATH I get the following:
    /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/MacGPG2/bin:/usr/local/m ysql/bin
    Help!

    Do you have a backup of this disk?  If not, go get one of those now.
    Do you have a pointer to whatever directions or installer tools you were following or using?  (So we might see what's been suggested and the steps you've followed here.)
    Do other logins work?  If you log in as a different user and launch Terminal.app and try some commands, does that environment work?
    Your PATH looks OK  — you have the important bits /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin — and the rest of what's there shouldn't be relevent to commands such as ls, cat or mv, so the next question would involve whether the tools and files and directories themselves exist.
    Do explicit paths such as /bin/ls, /bin/cat or /bin/mv work as expected?  (Most of the core commands for the command line environment are located in /bin).  Try the following command:
    /bin/ls /bin
    That command should displaty ~37 common shell commands and tools.

Maybe you are looking for

  • Sap system to mainframe.

    In the Integration Directory, with a file reciever communication channel, I was wondering if there is a way to get ftp commands for file memory specifications to work with the SITE command using the Run Operating System Command Before Message Process

  • Crash problem with Edits

    If anyone can help me here I'd appreciate it. I have one song that repeatedly crashes whenever I do an edit on an audio region and then put a crossfade in. As soon as I press play, to hear what I've just done, I get the spinning beachball and the Log

  • String to number and Number to String Problem!

    Hi All, In my report i ahve to display the Date. From DB i am getting 4 digit string( 2008). Using that i have to display as 08 - 09 In that i used RIGHT function. it is diplayed as 08 - 9. when i take 2 character from right '08' is coming. Then i co

  • "contribute cannot saved your changes on the website's shared settings on your website"

    Hello, I have this message : "contribute cannot saved your changes on the website's shared settings on your website". We use Contribute 3 (with windows 7) Could anyone explain me this message et give me a solution? Thnaks a lot (and sorry for my bad

  • What can I do to make sure all my information (Notes Included) transfers to my new MacBook Pro when connecting for the first time?

    I am about to connecting my Iphone to my new Macbook Pro for the first time. I just want to make sure that all my information: contacts, messages, notes, everything will still be on my phone. I just dont want to connect then find out I lost everythin