Terminal- Wrong command.

Earlier today I was trying to force-delete from my trash. But instead of
rm ~/.Trash/*
I typed in:
rm -rf ~/.trash /*
What happened next scared the lights out of me. It seemed that it was trashing everything/deleting everything but luckily most of the lines have said at the end  "Permission Denied"
After that I checked my finder to see if my files and downloaded apps were still there, my finder for once, didn't know the size of any. But after a while it did.
Here's a 1/1500 of what happened in terminal.
Please, Answer quick
-Classified

Having put a space before "/*" directed the command to erase all files on your startup volume. Without the "sudo" command all system files would return the Permission Denied error. However, to be on the safe side I think you should reinstall Lion:
Reinstalling Lion/Mountain Lion Without Erasing the Drive
Boot to the Recovery HD: Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the main menu. Repair the Hard Drive and Permissions as follows.
When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu.
Reinstall Lion/Mountain Lion: Select Reinstall Lion/Mountain Lion and click on the Continue button.
Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.

Similar Messages

  • Where is the terminal "last" command getting it's information from?

    I searching for the information that the terminal "last" command holds.
    When I execute the "last' command...... I am seeing too little to be real..... something is up..... I need to determine when the information was deleted.
    What log file is the last command using? In Mt. Lion, in Lion, in Snow Leopard?
    Thanx for your help

    For those who are reading this, this is about a Mt. Lion system with current patches 10.8.3
    Thank you for the reply and the pointer to the audit directory.
    I am continuing to ponder why last at the terminal is given unexpected behavior. I am now noticing the history in last is only for the "last" - no pun intended - 24 hours or there abouts on one of my systems. In the audit directory there are many more entries
    Wed Mar 20 09:47:14 terry@mymac:~ >>last
    terry   ttys001                   Wed Mar 20 09:47   still logged in
    terry   ttys000                   Wed Mar 20 09:47   still logged in
    terry   console                   Wed Mar 20 09:41   still logged in
    reboot    ~                         Wed Mar 20 09:39
    shutdown  ~                         Wed Mar 20 09:39
    terry   ttys001                   Wed Mar 20 09:03 - 09:13  (00:09)
    terry   ttys000                   Wed Mar 20 09:03 - 09:13  (00:09)
    terry   console                   Wed Mar 20 09:03 - 09:39  (00:35)
    reboot    ~                         Wed Mar 20 09:00
    wtmp begins Wed Mar 20 00:56
    >>sudo ls -lsa /var/audit/
    256 -r--r-----
    1 root  wheel   130862 Nov 24 14:52 20121124213110.20121124225215
      56 -r--r-----
    1 root  wheel
    26733 Nov 24 15:23 20121124225256.20121124232301
      40 -r--r-----
    1 root  wheel
    19634 Nov 24 15:43 20121124232348.20121124234351
    and then DOZENS and DOZENS more.... and finally those for yesterday are missing and then today.
    2016 -r--r-----
    1 root  wheel  1031355 Mar 18 23:31 20130318150701.20130319063139
    840 -r--r-----
    1 root  wheel   426232 Mar 20 00:56 20130319154442.20130320075621
      56 -r--r-----
    1 root  wheel
    26259 Mar 20 09:39 20130320160056.20130320163908
      40 -r--r-----
    1 root  wheel
    19050 Mar 20 09:55 20130320163956.not_terminated
    Also when I look thru the list of audit file  the 15th and the 10th of Mar are missing..... hummmmm...
    Any idea what could cause this?
    I am suspicion of some sort of hacking but just see any direct evidence of it ....
    I have gone an gotten the source code for last at the BSD project but Im' not a c programmer and apple's version is a branch or so it seems to me cause they've got to be different and I'm not sure where to configure last or how to better understand what I'm seeing.
    Anyone care to help me understand what could be going on?

  • Sending Mail to Local Users via the Terminal mail Command

    I am having trouble sending mail to other user account via the terminal mail command. It seems to work with some accounts i.e. guest, etc, but fails with others i.e. Dennis. It will fail with no error message. Has anyone had any experience using the unix mail command locally ?
    Dennis

    I don't know the answer to this but you might try the -v option on the mail command in order to get verbose output. Perhaps a useful message would pop up.
    Also, you might consider posting this message in the Unix Forum. There is a good chance that someone there can help you with this issue.
    EMAC G4 1.0 GHz   Mac OS X (10.4.6)  

  • Execute command in terminal with command?

    What in terminal would I have to type to open another terminal with a command? I want to have something that can control my alsa levels in my openbox menu.
    Oh and just a side question, what happened to weatherget? Pacman says the package doesn't exist. Is it in the AUR or am I just using the wrong package name?

    Thanks that worked.
    The python script however doesn't support my weather code ((CXTO)It's out of range).
    Anyone know one that does support Canada so I don't have to a bunch of them?
    Last edited by cryticfarm (2009-08-07 03:50:39)

  • Terminal - emacs command problem

    Reading some interesting information on a Mac Hints website, I discovered you could play some simple games in Terminal using the 'emacs' command. But it doesn't seem to work.
    I can get the list of games using the: *ls /usr/share/emacs/21.2/lisp/play* command but when I type 'emacs' after to enable the playing of the games I get the following message:
    *dumpemacs: Must be run as root unless -n is used*
    *emacs: child exited with status 1*
    According to the website I read, it should start emacs, then I use Esc+x to go back to the prompt then type the name of the game I want to play but after that message has appeared, if I type the name of a game, I just get 'Command Not Found'
    What is wrong?

    Fixed the problem!
    I think it may be something to do with upgrading from Jaguar to Tiger but instead of typing 'emacs', if I type 'emacs-21.2.1' emacs starts up fine and I'm then able to access the hidden games and programs.
    Although I've solved the problem, is it possible to get it to run the emacs command by just typing 'emacs'?

  • "need ownership" on terminal eraseDisk command

    I tried the following command in terminal upon some surplus backup cartridges to make them my own.
    "diskutil eraseDisk HFS+ newdisk "/Volumes/1-Monthly"
    I also tried the iteration using eraseVolume instead, and both times even while using an Admin account it told me I had to have ownership of the carts. They are read/writable iOmega Rev 35 gig devices and the single file on each of a half dozen carts are locked Retrospect backup files. I tried force-changing the extensions of the file, using Disk Utility (Gui AND Terminal), Techtool Pro 6, PPC and Intel machines I own, and leaving the cart on a large bass speaker magnet overnight. Then I tried a Lee Valley super magnet that is the same size as the cart and can lift a 7 lb chunk of metal. My hope was I get the "This disk is unreadable. Initialize?" warning message.
    Dont care whats on them. Seller doesnt know any password for 'ownership'.
    Waiting for Retrospect to get back to me via email with some hints, since a full working trial version of their app doesnt let me erase either.
    Any Unix nerds out there can help? Ideas, hints?

    Retrospect said this is not their software cause. Fine but I asked them for help to remove a locked Retrospect file, whether it needs unlocking before trashing or not doesnt matter to me.
    Been on the forum at Lenovo who now handles the iOmega product line support and pretty much the same Unix commands. I tried it both with sudo and no sudo while in Administration control of my machine on both osx 10.5 and 10.7.x machines but still nothing.
    I did wind up getting a full working trial copy of Retrospect for both OS's but that doesnt help.
    Although the Finder's inspector window says its now formatted in Mac Extended format, it actually isnt. It is still not available for drag and drop or Time Machine access.
    It does show up in Disk Utilities just once before I try force reformatting (erase is only available in the app, not format) with hopes this would work but it doesnt. Unix commands dont give me this response but the disk utility app does: "optical erase failed; not completed or completed with errors. See diskrecording.log (from in console) for more information"
    Console app shows this error in more detail:
    "Disk Utility: Erase started, Sat Oct 26 11:23:05 2013
    Disk Utility: Erasing CD-RW media in Iomega RRD 83.B with generic profile via FireWire.
    Disk Utility: Erase failed, Sat Oct 26 11:23:07 2013
    Disk Utility: Erase sense: 5/20/00 Illegal Request, Invalid command operation code
    Disk Utility: Erase error: 0x80020022 The device failed to respond properly, unable to recover or retry."
    It does show up in Retrospect Express accessibility, but dislike the software so much I would prefer to not use it. Looks to me like the same interface and horrible GUI from the OS 9 days, when it was a pain to use too.
    Pretty much out of ideas...

  • Terminal rm command help needed

    While looking for another problem on my Mac I had the Console open.  I noticed quite a few messages involving something called Pogoplug*:
    8/28/12 5:07:49.794 PM com.apple.launchd.peruser.502[223]: (com.pogoplug.PogoplugMonitor[721]) Exited with code: 1
    8/28/12 5:07:49.794 PM com.apple.launchd.peruser.502[223]: (com.pogoplug.PogoplugMonitor) Throttling respawn: Will start in 10 seconds
    8/28/12 5:07:59.814 PM com.apple.launchd.peruser.502[223]: (com.pogoplug.PogoplugMonitor[723]) Exited with code: 1
    8/28/12 5:07:59.814 PM com.apple.launchd.peruser.502[223]: (com.pogoplug.PogoplugMonitor) Throttling respawn: Will start in 10 seconds
    8/28/12 5:08:09.832 PM com.apple.launchd.peruser.502[223]: (com.pogoplug.PogoplugMonitor[725]) Exited with code: 1
    8/28/12 5:08:09.832 PM com.apple.launchd.peruser.502[223]: (com.pogoplug.PogoplugMonitor) Throttling respawn: Will start in 10 seconds
    8/28/12 5:08:19.851 PM com.apple.launchd.peruser.502[223]: (com.pogoplug.PogoplugMonitor[728]) Exited with code: 1
    8/28/12 5:08:19.851 PM com.apple.launchd.peruser.502[223]: (com.pogoplug.PogoplugMonitor) Throttling respawn: Will start in 10 seconds
    8/28/12 5:08:29.869 PM com.apple.launchd.peruser.502[223]: (com.pogoplug.PogoplugMonitor[729]) Exited with code: 1
    8/28/12 5:08:29.869 PM com.apple.launchd.peruser.502[223]: (com.pogoplug.PogoplugMonitor) Throttling respawn: Will start in 10 seconds
    In Terminal I did a
    sudo find / | grep pogoplug
    and that returned lots of files with *pogoplug* as part of the filename.
    Now what I need to learn is how to do a mass deletion of anything pogoplug related as I do not use this anymore and it seems to be clogging my system.
    I tried a basic rm -R *pogoplug* but that didn't work.  (unsurprising)
    Please note that these files found by the find command turned up files on a couple of external drives as well, so what I'd like to do is totally delete anything with "pogoplug" in the file or directory name.
    * I used the app Pogoplug a few months ago to evaluate a NAS setup.  Pogoplug came with it.  I had thought that I had deleted everything when I dragged the app to AppCleaner but apparently not.
    Any help would be appreciated.
    -Tod

    I would absolutely not recommend trying to use the rm command to deal with this problem. It's too dangerous to mess around with unless you know exactly what you're doing.
    Things like AppCleaner aren't very reliable for uninstalling complex software. You need to use the uninstaller provided by the makers of the software. They supply an uninstall script here:
    http://support.pogoplug.com/entries/21414333-how-do-i-uninstall-and-reinstall-po goplug-companion-software-on-a-mac

  • Terminal "open" command misbehaving

    In Terminal, when I use the "open" command on any folder, I expect that folder to open in the Finder. For example, "open /Applications" should open the Applications folder in the Finder.
    This does not happen for me. Instead, iTunes opens and starts to import any music files it can find in the folder I specified. This does not happen when I double-click on a folder in the Finder.
    I have rebuilt the LaunchServices database (using Yasu) but that didn't help. Any advice would be greatly appreciated.

    (highland_park:~)$ which open
    /usr/bin/open
    When I double-click Applications (or any other folder) in the Finder, the folder opens normally. (This is with View->As Icons selected.)
    I have nothing in ~/LIbrary/Workflows.
    I just discovered that if I put any folder in the dock, right-click on it, and select "Open [folder name]", then it opens in iTunes. (Does this just trigger the open command?)
    I'm enjoying poking around, and I very much appreciate all the suggestions.

  • Voice Control - does it learn and what's the "Wrong" command for?

    1) Like others, I find Voice Control laughably inaccurate sometimes when trying to get it to play an artist. I'm wondering if it "learns" and gets better the more you use it?
    2) In the manual, there's a command you can called "wrong" or "nope". In what situation would I use it? Whenever I've tried so far, by the time I get to say it, the original (incorrect) command has already executed!

    "Wrong" or "No" is for stopping a command and returning voice control to the listening phase. "Cancel" takes you out of voice control. If the command is to play or call a specific name, you can cancel it, but if it's a simple command like "play", "shuffle", "genius", or "what's playing" there is no cancel.
    VC for iPod control seems to have a serious bug. It's not inaccurate, it's just not working.
    There seems to be a condition where it will only recognize the first few artists in your library, and often not at all. I have restored my phone several times, rebuilt my iTunes library on the PC, and have yet to get it working properly.
    I have experienced, variously, after each restore and reload of the phone:
    - Voice control will not start, or never gets to where it is listening (with the waveform). This can usually be fixed by a hard reset.
    - Only artists from the first part of the alphabet are recognized. Only albums by these artists are recognized, regardless of letter. If I say anything else, it will pick the artist/album from these artists that sounds the most like what I say. One time it was artists A-F, the other time it was just the first 4 "A" artists. Contacts and playlists are recognized OK.
    - Even worse: No artists, albums, or playlists are recognized. Simple commands and contacts still work. This is where I'm at now, after a clean load of iTunes, a newly built iTunes library, a complete restore of the iPhone software, and set up as a NEW phone (no backup restored). That's as clean as you can get.
    I've been to the Genius Bar, and I've called support. Both times they have escalated my case to an an engineer. Apple is willing to replace my phone in-store tomorrow, but I don't think it is a hardware problem: The mic works, the headset mic works, and other VC features work.
    The only thing I can think of at this point is there is some artist/album name in my library that is causing it to fail?

  • Issuing terminal cmd commands?

    Hi, im looking for a way to issue terminal commands from
    flash applications. I would like to execute exes and jars file from
    within the flash application.
    Examples would be:
    C:/Examples/Example.exe or
    java -jar "C:/Example/Examples.jar"
    I am currently researching AIR application and flash
    projectors.
    if anyone has any ideas please post. Thanks

    Try FlashJester JStart
    http://jstart.flashjester.com
    Regards
    FlashJester Support Team
    e. - [email protected]
    w. - www.flashjester.com
    "This has been one of the most impressive and thoroughly
    pleasant
    experiences of customer support I have ever come across -
    astounding!"
    Director - hedgeapple

  • Terminal Installation Commands

    I have a silent install of Symantec Endpoint Protection package and ready to install to several client Mac systems. I am having issues creating a script to execute the installation however.
    Please advise:
    SYSTEM:~ USERNAME$ sudo /usr/sbin/installer -pkg "/usr/desktop/symantec endpoint protection.mpkg" -target "/usr/applications"
    installer: Error the package path specified was invalid: '/usr/desktop/symantec endpoint protection.mpkg'

    And is providing the above information more appropriate?
    As far as guiding the OP to solve his problem? yes... certainly when taken in context with the rest of the post. I explained why I think his original command failed, provided pointers for more likely options.
    Are you sure that the command above will properly install the software?
    Am I sure? no, but I included a caveat that I "...expect this to have more chance of success". There are no guarantees since it depends on details that I'm not privvy to, including the actual location of the package itself. Hopefully the rest of the details in my post give sufficient direction.
    Are you sure it won't delete vital portions of the OS and/or other applications?
    Unlikely. As much as you and I don't like Symantec I doubt their installers are going to do something that draconian. That would put a really big egg over Symantec's face, especially in the enterprise market which is who they cater to.
    Granted, it will likely work fine, but I have more confidence in double-clicking it in the Finder
    I do prefer the Finder, too. The GUI installer is far preferable for most users, however the OP stated that he was trying to create a silent (presumably headless/unattended) install and that precudes the use of the GUI installer which requires numerous clicks and keyboard input from the user.
    At the end of the day, Apple provide a command-line interface to the package installer because it's more convenient in some cases, especially for admins coming from other UNIX/Linux environments. There's nothing wrong with guiding a user through the idosyncrasies of Apple's installer syntax/command line switches.

  • Terminal SSH commands

    Hi,
    I am experimenting with SSH using Terminal on Leopard. I have logged in to my remote server and have made changes to /etc/localdomains however I have no clue on how to save the changes. I tried 'command + S' but that saves it to local machine as a text file. Can you advice what command I need to use? Your help is much appreciated. thanks.

    I don't see how anybody could find textedit faster than vi if you're familiar with vi. Your hands never have to leave the keyboard. If you're going to be doing much development on the Unix side it's well worth learning vi.

  • Terminal Startup Commands

    So I was reading online about how to make Terminal run a command on startup. When entering the commands to make it run a command on the start of Terminal I guess I messed up, now whenever I start Terminal it says [Process Completed] and wont let me enter any more commands. It also does this when I open a new shell. I want to know if there is a way to delete this startup command so Terminal opens as it does out of the box.

    Or this shell script->
    #!/bin/sh
    #showallfiles
    # Description and usage message
    usage () {
    echo "
    Description:
    A simple shell script to reveal/conceal files
    hidden in Mac OS X Finder application.
    showallfiles excepts one option.
    Usage: ${0##*/} [-h|--help] to show this help
    ${0##*/} [on|ON] to show hidden files
    ${0##*/} [off|OFF] to set the default hidden files
    Example: ${0##*/} on
    # Test for more than one option
    if [ $# -gt 1 ]
    then echo "${0##*/} -h to access help"; exit
    fi
    # Get the AppleShowAllFiles status in the domain com.apple.finder.plist or create the default off setting
    STATUS=`defaults read com.apple.finder AppleShowAllFiles 2>/dev/null` || STATUS=`defaults write com.apple.finder AppleShowAllFiles OFF`
    # Function to check AppleShowAllFiles status and change the status if necessary
    finderfilesstatus () {
    if [ "$STATUS" = "$SAF_OPT" ]
    then
    echo "AppleShowAllFiles is set to $SAF_OPT"
    else
    defaults write com.apple.finder AppleShowAllFiles $SAF_OPT
    osascript -e 'tell application "Finder" to quit' -e 'delay 1' -e 'tell application "Finder" to launch'
    fi
    # Parse the command option
    case "$1" in
    '-h'|'--help') usage; exit;;
    'on'|'ON') SAF_OPT="ON"; finderfilesstatus;;
    'off'|'OFF') SAF_OPT="OFF"; finderfilesstatus;;
    *) echo "${0##*/} -h to access help"; exit;;
    esac

  • Terminal security commands

    Hello,
    Please, direct me to information on using terminal for security commands?
    cynthiafrommn

    Yes, BobHarrris:
    I'm trying to change this:
    Ping Reply: RECEIVED (FAILED) — Your system REPLIED to our Ping (ICMP Echo) requests, making it visible on the Internet. Most personal firewalls can be configured to block, drop, and ignore such ping requests in order to better hide systems from hackers. This is highly recommended since "Ping" is among the oldest and most common methods used to locate systems prior to further exploitation.
    I know the command to do this in Snow Leopard but since it has been changed in Lion, I'm trying to get those commands.
    I'm trying to be completely invisible to hackers.
    Thank you, for your reply.

  • Terminal: "Completed Command"

    I went to use Terminal today and was confronted with an empty window with "Completed Command" as the title. I noticed this topic here from about a month ago, but it doesn't help me. This is what I have tried and none of them work:
    Removing com.apple.terminal.plist
    Logging out and back in again.
    Restarting completely.
    Opening a new Terminal session.
    The prefs are set to the default /usr/bin/login, but changing this to execute /bin/bash on startup also has no effect.
    Help. I feel a bit stuck without a way to the command line!

    Problem solved - I deleted the prefs file and then restarted and that did it!

Maybe you are looking for