I'm new in flutter I want to set flutter sdk path in Mac OS (VS code) for this I'm fallow the https://flutter.dev/docs/get-started/install/macos#update-your-path but when I run $HOME/.zshrc in Terminal It show error message zsh: permission denied: /Users/macbookpro/.zshrc I also apply this Terminal error: zsh: permission denied: ./startup.sh but this is not work for me.. can some one help me
step.1
Open your terminal.
step.2
cd ~
vim .zshrc
step.3
Pass i to insert,and insert your flutter path(/bin:/Library/flutter/bin) behind .bin:$PATH/.
If you are done, press esc and enter :wq.
example
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH/bin:/Library/flutter/bin"
If you want to evaluate its content inside your current zsh process, you can do a
source ~/.zshrc
You need to set the execute permission on the file, as you do for any other command which you want to execute, i.e.
chmod +x ~/.zshrc
For saving time, a little bit edited answer.
Commands in the terminal
cd ~
nano .zshrc
In the editor add path to the folder, for example
path+=('/usr/local/bin/ntfy')
Save, exit. Apply changes to current terminal
source ~/.zshrc
PS Check that in the file presents a line with export.
Related
When I try to move my iOS backup folder (which does not yet have any backups) to my external hdd, the command line (on Mac) tells me that the command -s is not found.
This was the directory which I've tried to link the iTunes backups to:
user123#user123s-MacBook-Pro ~ % -s /Volumes/Personal/user123/iOSBackup/Old_Backup/ ~/Library/Application\ Support/MobileSync
zsh: command not found: -s
when I entered it manually instead of copy pasting it, it said that permission was denied, even though I had granted full disk access to the terminal app before for coding in vs code and such...
Thanks!
Well, the first problem is that you’re trying to execute -s rather than ln -s.
What is the goal of your ln operation? To symlink the folder called Old_Backup inside the MobileSync directory? That won’t work if your intention is that additional backups go to Old_Backup. You should symlink the Old_Backup directory to the location and name it originally had.
I have recently installed PIPX on MAC running Big Sur and ZSH shell. During the install it prompted for the following to be added to the .zshrc file....
# Created by `pipx` on 2021-03-20 14:22:23
export PATH="$PATH:/Users/xxxx/.local/bin"
eval "$(register-python-argcomplete pipx)"
Running echo $PATH showed /Users/xxxx/.local/bin added to the end of my PATH variable. However, when I close the terminal and open up a new session, running echo $PATH now shows the location duplicated at the end of the PATH :/Users/xxxx/.local/bin:/Users/xxxx/.local/bin
Opening and closing new terminal sessions doesn't seem to create any more additions to PATH it just remains at these 2 entries....
I have run typeset -U PATH path to remove the duplicate but each time I open up new terminal sessions it just duplicates again.
Does anybody know how I can stop this from happening.....I would really like to keep my PATH variable as clean as possible.
Add the following path to your .zshrc file :
export PATH="${PATH}:$(python3 -c 'import site; print(site.USER_BASE)')/bin"
Reference: [command not found: pipx]: https://github.com/pipxproject/pipx/issues/283
I'm trying to extend my $PATH variable in git bash (MinGW shell) by adding the following to the file ~/.bashrc
PATH=$PATH':/c/Program Files/maven/apache-maven-3.2.5/bin'
After I did this and restarted the bash it seems like that the $PATH variable was extended like expected:
$ echo $PATH
MANY_OTHER_PATHS:/c/Program Files/maven/apache-maven-3.2.5/bin
But I still cannot execute the programms in the given directory:
$ mvn
bash: mvn: command not found
What went wrong here? How do I extend the PATH variable correctly?
Here are two ideas.
You can have your path with double quote mark.
export PATH=$PATH:"/C/Program Files (x86)/apache-maven-3.3.3/bin"
Or, You can also make symbolic link for the directory.
ln -s "/C/Program Files (x86)/apache-maven-3.3.3/bin" ./mvnbin
export PATH=$PATH:/your-path/mvnbin
It works for me in mingw32 environment.
I needed to add something to my Git Bash path permanently each time I open it. It was Meld.exe path which can be added with:
export PATH=$PATH:"/C/Program Files (x86)/Meld/lib"
In order to execute this command each bash session, you need a ~/.bashrc file. Check if it already exists or create it using notepad ~/.bashrc or touch ~/.bashrc.
You can check where it is with:
echo ~
Open it and add the command that adds the PATH (first command in this response).
I hope you found this useful.
According to this SO post, you need to escape Program Files with quotes. git-bash $PATH cannot parse windows directory with space
Add PATH in Git Bash Permanently | Windows Only
Just in case you are still wondering how to add a path permanently in git bash here is the step-by-step process for Windows users:
Create .bashrc in user's root folder using the below command. It will open notepad and ask you to create the file, click yes.
notepad ~/.bashrc
Put the directory you want to add as below, for more than 1 items repeat the same format in next line:
export PATH=$PATH:"/c/folder/folder/"
Save the file and relaunch the bash.
Next launch will give you a warning like WARNING: Found ~/.bashrc but no ~/.bash_profile, ~/.bash_login or ~/.profile. but git bash will handle it by creating the required files.
SOME INSIGHTS
Git Bash doesn't fetch Window's environment PATH, it maintains its PATH separately in more like a Linux way.
You can run export PATH=$PATH:"/c/folder/folder/" in cmd to add a directory to path, but it will be only for the current session once you close the bash, it will be gone.
.bashrc is a shell script file that will be executed every time you launch a new git bash window. So you can add any type of bash command here. We simply added the export command to add our desired directory to PATH.
I'm a complete newbie, so I think I'm just missing a step, but have no idea.
I'm following tutorials for Rails. Lots of steps say, "and then editing the ~/.zshrc file." but I don't have any ~/.zshrc file. I'm looking at the folders in Sublime. Also none of the following ~/.zprofile, ~/.zlogin, ~/.zlogout exist. Though, under my home files, there is .zprezto folder. No zshenv either...
Do I just create the files? Seems like they should be downloaded from somewhere. I'm using Terminal with OS X. So lost.
echo 'write whatever' >.zshrc
Thanks in advance!
You will get ~/.zshrc file only when you use zsh shell on your Mac OS. If you're not sure which shell you're using, open terminal and issue the following command.
echo $SHELL
if you get response like /bin/zsh then you're using zsh shell on your Mac. You can edit ~/.zshrc file using vim editor on your Mac which is the default for Mac OS.
to open ~/.zshrc file using vim editor, issue the following command on your terminal.
vim ~/.zshrc
Then you can do any configurations you need. Or else you can use open -t .zshrc command to open ~/.zshrc file from your general TextEdit on Mac OS.
$ open ~/.zshrc
Make changes in the .zshrc file window that opens
Save file
$ source ~/.zshrc
The .zshrc file is used to configure your terminal prompt if you're using zsh (z-shell) login shell (n.b., a "login shell" is the command line presented to you when running the terminal application). If you're using a standard OSX terminal, then you're probably using bash (the BASH Shell), so editing .zshrc wouldn't affect anything. Bash uses .bashrc and .bash_profile` for it's configuration. These file are run overtime you open terminal window and setup things the command aliases, setup your prompt and maybe run scripts to initial other programs.
You almost certainly don't need to edit terminal config files to develop with Ruby on Rails, especially as editing these files incorrectly can mess up your system, or at least make it hard to return the system to a stable state.
I usually use the vi(vim) editor to edit the .zshrc file.
1)To open ~/.zshrc
vi .zshrc
or
vi ~/.zshrc
or
You can open the file in VsCode, and it would be easier to edit it.
code .zshrc
2)To update the edited .zshrc file:
source ~/.zshrc
or
source .zshrc
If you are using zsh shell , run the below lines in the terminal:
echo 'setopt PROMPT_CR' >.zshrc
echo 'setopt PROMPT_SP' >.zshrc
echo 'export PROMPT_EOL_MARK=""' >.zshrc
You can edit zshenv instead of zshrc for appending PATH . Please check whether file already exists
cat ~/.zshevn
You can edit file using below command
vi ~/.zshenv
You can refer this to see how to add an entry in PATH
I'm trying to run mate .rspec in my command prompt in order to open the .rspec configuration file. However, I get the error -bash: mate: command not found. Any ideas?
Though Brandon's answer is correct, there's a far simpler way to set up the mate command through TextMate itself.
In the menu bar, select Help > Terminal Usage..., choose /usr/bin from the dropdown, and it will create the link for you.
You might have to open a new Terminal window for it to take effect, but then you should be all set.
[Update]
T.J.'s answer is much better than mine. :)
[Original Answer]
TextMate installs the mate command to /usr/local/bin/mate. First, I would check to see if the mate command is in that directory:
ls -lah /usr/local/bin/mate
If you get ls: /usr/local/bin/mate: No such file or directory, then you can install the mate command by creating a symbolic link to the binary, which lives in the TextMate.app folder:
sudo ln -s /Applications/TextMate.app/Contents/Resources/mate /usr/local/bin/mate
At this point, you should be able to run mate from the command line.
If you got output other than No such file or directory from the ls command, it means that /usr/local/bin is not on your path.