0

I have an application I downloaded in a form of .app file in downloads.
How can I copy it to /Applications using the terminal?

Since it is actually a folder I can use cp directly so it seems.
Using recursive operation requires creating the folder in /Applications prior to copying.
Is there a way around this?

11
  • Technically speaking, you can just copy the folder, but there's more to an App than just the folder in /Applications; there are likely folders in /Library and ~/Library/. What exactly are you trying to accomplish with this?
    – Allan
    Commented Aug 3, 2023 at 19:21
  • @Allan, Just "install" it. Commented Aug 3, 2023 at 19:49
  • Copy the file to Applications. Once and done.
    – Allan
    Commented Aug 3, 2023 at 19:53
  • 1
    @Allan If there's no Installer package, and the normal way to install the application is just by dragging it to Applications, then nothing needs to be done in those folders.
    – Barmar
    Commented Aug 3, 2023 at 20:39
  • 2
    Assuming that SRC and DEST are existing directories, cp -R SRC/ DEST copies the content inside SRC (with all subdirs etc.) into DEST. cp -R SRC DEST creates a directory DEST/SRC and copies everything from within SRC into this new directory. Note that the use of SRC/ is specific to MacOS (i.e. BSD unix). If you are using Gnu cp, you have to write cp -r SRC/* DEST. Commented Aug 4, 2023 at 11:16

2 Answers 2

3

Assuming that SRC and DEST are existing directories, cp -R SRC/ DEST copies the content inside SRC (with all subdirs etc.) into DEST. cp -R SRC DEST creates a directory DEST/SRC and copies everything from within SRC into this new directory. Note that the use of SRC/ is specific to MacOS (i.e. BSD unix).

If you are using Gnu cp, you have to write

setopt -s dotglob
cp -r SRC/* DEST

The dotglob ensures that youa re also copying hidden files.

4

I assume you don't need the application in ~/Downloads afterwards, so

mv ~/Downloads/NAME.app /Applications/

should do. If you get a "Permission denied" error, add sudo in front and enter your password on the prompt.

2
  • What if only copy is needed? Commented Aug 3, 2023 at 19:48
  • 1
    @GeorgeIrwin cp -Rp should also work. Please clarify your question though: the text asks for "copy", one comment for "the equivalent of dragging in finder".
    – nohillside
    Commented Aug 3, 2023 at 20:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .