OS X cp command in Terminal — No such file or directory
this might be one of those days my brain just does not work, or i’m incredibly dumb. i’ve been trying to copy files (which are actually directories .app, .bundle, etc.) but consistently get an error ‘No such file or directory’. i’ve tried every possible combination of using no / slash, using the file name, using no file name. help! :/
destination directory: /library/application\ support/directory
so in otherwords, the file.bundle needs to go in that ^ directory
4 Answers 4
Summary of solution:
directory is neither an existing file nor directory. As it turns out, the real name is directory.1 as revealed by ls -la $HOME/Desktop/ .
The complete working command is
with the -R parameter for recursive copy (compulsory for copying directories).
I know this question has already been answered, but another option is simply to open the destination and source folders in Finder and then drag and drop them into the terminal. The paths will automatically be copied and properly formatted (thus negating the need to actually figure out proper file names/extensions).
I have to do over-network copies between Mac and Windows machines, sometimes fairly deep down in filetrees, and have found this the most effective way to do so.
cp -r [drag and drop source folder from finder] [drag and drop destination folder from finder]
On OS X Sierra 10.12, None of the above work. cd then drag and drop does not work. No spacing or other fixes work. I cannot cd into
/Library Support using any technique that I can find. Is this a security feature?
I’m going to try disabling SIP and see if it makes a difference.
In my case, I had accidentally named a folder ‘samples ‘. I couldn’t see the space when I did ‘ls -la’.
Eventually I realized this when I tried tabbing to autocomplete and saw ‘samples\ /’.
Not the answer you’re looking for? Browse other questions tagged macos terminal cp or ask your own question.
Related
Hot Network Questions
Subscribe to RSS
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
site design / logo © 2020 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2020.9.18.37632
Cannot navigate directory in my terminal on mac OS X. I got “No such file or directory”
I want to navigate directory in terminal. But I always got error message like this
“-bash: cd/Applications/Xcode-beta: No such file or directory”
My mac OS X is El Capitan. I am using the following command on my terminal.
1 Answer 1
you want cd «/Applications/Xcode-beta 2.app» instead of cd/Applications/Xcode-beta 2.app . Note the space after cd. What you were trying to do was to execute the file in cd/Applications/ called Xcode-beta with 2.app as an argument, but obviously — it does not exist.
Also, note the quotation of Xcode-beta 2.app . Cd accepts only one argument and since there’s a space in the name of this directory ( on side note — this doesn’t look like a directory name, but who knows ) it will be interpreted as a separate argument to cd.
Question: Q: terminal bash no such file or directory
Hello, Everytime I open terminal I start terminal I get this:
-bash: /usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/git/bin: No such file or directory
but I have done ls command on each of the components of the path and they all exist & have contents.
What am I missing? How do I remedy this?
I updated to El Capitan last week if that makes any difference.
MacBook Pro, OS X El Capitan (10.11.5)
Posted on May 27, 2016 6:16 AM
I think whatever you installed to run Python messed up the PATH.
Edit the .bash_profile and change that first line to:
Posted on Jun 2, 2016 8:04 PM
All replies
Loading page content
Page content loaded
Is there anything in Shells open with Command, and Command (complete path) is selected?
How about Profiles tab, Startup Run Command is selected and has some command entered?
If not, I would think that maybe something in your .bash_profile is corrupted. It looks like the export PATH is not actually exporting but trying to run that string as a command.
Question: Q: -bash: your: No such file or directory
I see this when I open up Terminal. I an on a Macbook Pro with Sierra. I’m not sure what to do from here. Here is the whole thing:
Last login: Tue Apr 18 09:33:31 on ttys000
-bash: your: No such file or directory
MacBook Pro, macOS Sierra (10.12.4), 15″ display
Posted on Apr 18, 2017 9:52 AM
All replies
Loading page content
Page content loaded
This suggests that some command you have on your .bash_profile is giving an error.
This is a file in your home directory that contains commands that are executed when a bash shell starts.
Copy and paste the following command in a Terminal window and let us know what you get:
Apr 18, 2017 10:52 AM
Hi thanks for responding. This is what I got:
export PATH=$PATH:/Users/ /Library/Android/sdk/platform-tools/
Apr 18, 2017 9:40 PM
Also, not sure why there is a «$» after my user name. My directory shows sfjenn. Or is the $ part of a command a command?
Apr 18, 2017 9:42 PM
I’m guessing somehow your .bashrc file has some incorrect commands in it. Try renaming the file in Finder (you need to show invisible files to see it with Shift+Command+. keyboard shortcut) to something else (for example .bashrc_bad), and then start Terminal.app again. If that works you can then in the Terminal window:
and post the results and we can try and give you some input on what is bad.
Apr 18, 2017 11:36 PM
/.profile or even possibly /etc/profile.
Apr 18, 2017 11:39 PM
Hi thanks for responding. This is what I got:
export PATH=$PATH:/Users/ /Library/Android/sdk/platform-tools/
See the word «your» in there? Where it says » » it was supposed to be a placeholder, to be replaced by your short username (i.e., the name that appears next to the home folder in your Finder sidebar), but you left it literally.
The effect of that command (which, of course, is not working as it is) was to allow command line access to some tools for developing for Android. You obviously haven’t been using those, at least not from the command line.
If you don’t care about running stuff for running some sdk for Android from the command line, just delete this file by copying and pasting the following line exactly, to a Terminal window, and pressing enter:
The next time your ran bash (or open a new Terminal window) you won’t see the error anymore.
Команда OS X cp в Терминале — Нет такого файла или каталога
это может быть один из тех дней, когда мой мозг просто не работает, или я невероятно туп. Я пытался скопировать файлы (которые на самом деле являются каталогами .app, .bundle и т. д.), но постоянно получаю сообщение об ошибке «Нет такого файла или каталога». Я пробовал все возможные комбинации использования без /слэш, используя имя файла, без имени файла. Помогите! : /
целевой каталог: /library/application\ support/directory
поэтому, другими словами, file.bundle нужно перейти в этот каталог ^
2 ответа
Краткое описание решения:
directory не является ни существующим файлом, ни каталогом. Как оказалось, настоящее имя directory.1 , как показано ls -la $HOME/Desktop/
Полная рабочая команда
с параметром -R для рекурсивного копирования (обязательно для копирования каталогов).
В OS X Sierra 10.12 ни одна из вышеперечисленных работ не работает. cd, то перетаскивание не работает. Нет пробелов или других исправлений. Я не могу перейти в
/Library Support, используя любую технику, которую смогу найти. Это функция безопасности?
Я собираюсь попробовать отключить SIP и посмотреть, будет ли это иметь значение.
Getting `No such file or directory` when executing any terminal command (caused by VMware Fusion)
I am using macOS High Sierra and I am getting the following error when trying to install a script:
Apparently has something to do either with rvm or Fusion.app , which I don’t have that app, what I have is VMWare Fusion.app .
2 Answers 2
VMWare changes your $PATH variable, but it does not do in .profile , or /etc/profile , neither the globals or locals bashrc or zshrc files.
It has it’s own file inside /etc/paths.d . The file is called com.vmware.fusion.public .
You need sudo rights to change the file:
The file is readonly and it has as content:
Notice there are not quotes around it, and the space character is not escaped. You need to add a \ after the VMWare and before the white space.
Open a new terminal window and run your command again, you should not have that error anymore.
Terminal error: execvp(3) failed.: No such file or directory #5
Comments
Copy link Quote reply
ogail commented Mar 12, 2016
Hi,
I am using PlatformIO on mac os x El-Capitan, when I click on the + for open a new terminal session I get error execvp(3) failed.: No such file or directory . I have searched online and it says that I need to install java and I’ve verified java exists by java —version , would appreciate help.
I have tried build and upload to Arduino and they worked perfectly.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Copy link Quote reply
ogail commented Mar 12, 2016
Found the solution! Atom 2 must be opened with sudo from terminal to avoid this problem. If there is a better way please advise, otherwise feel free to close the issue.
Copy link Quote reply
dmytrokyrychuk commented Mar 12, 2016
Does this occur when you click + exclusively, or does this also occur when you open a Serial Monitor?
Copy link Quote reply
simonmittag commented May 31, 2016 •
I’m experiencing this as well now. With or without sudo when launching with «+». Edit: in my case, the bash executable path was pointing to a wrong location. Now fixed.