You have to open that file with a text editor and then save it.
touch ~/.bash_profile; open ~/.bash_profile
It will open the file with TextEdit, paste your things and then save it. If you open it again you’ll find your edits.
You can use other editors:
nano ~/.bash_profile mate ~/.bash_profile vim ~/.bash_profile
But if you don’t know how to use them, it’s easier to use the open
approach.
Alternatively, you can rely on pbpaste
. Copy
export ANDROID_HOME=/<installation location>/android-sdk-macosx export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
in the system clipboard and then in a shell run
pbpaste > ~/.bash_profile
Or alternatively you can also use cat
cat > ~/.bash_profile
(now cat
waits for input: paste the two export definitions and then hit Ctrl + D).
Related Posts:
- How do I pause my shell script for a second before continuing?
- What does export PS1=”\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ ” mean in MacOS’ bash Terminal?
- How do I execute a bash script in Terminal?
- How to switch Python versions in Terminal?
- How to reload .bashrc settings without logging out and back in again?
- mvn command not found in OSX Mavrerick
- cp: missing destination file operand after
- mvn command not found in OSX Mavrerick
- -bash: export: `=’: not a valid identifier
- How do I add a newline using printf?
- How to run C program on Mac OS X using Terminal?
- Error when using ‘sed’ with ‘find’ command on OS X: “invalid command code .”
- Cp: target is not a directory
- How to create a file in Linux from terminal window? [closed]
- In the shell, what does ” 2>&1 ” mean?
- Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)
- What is the preferred Bash shebang?
- How to compare strings in Bash
- How to decode Seagate’s hard drive date code in a Bash script
- How do I use a regex in a shell script?
- Installing Homebrew on OS X
- How to make “if not true condition”?
- Multi-line string with extra space (preserved indentation)
- Bash script and /bin/bash^M: bad interpreter: No such file or directory
- An “and” operator for an “if” statement in Bash
- ‘\r’: command not found – .bashrc / .bash_profile [duplicate]
- Why is the apt-get function not working in the terminal on Mac OS X v10.9 (Mavericks)?
- Echo newline in Bash prints literal \n
- Terminal error: zsh: permission denied: ./startup.sh
- Echo newline in Bash prints literal \n
- An “and” operator for an “if” statement in Bash
- How can I declare and use Boolean variables in a shell script?
- What is the meaning of 2 in 2> /dev/null
- How to reload .bash_profile from the command line?
- What is the purpose of “&&” in a shell command?
- Replace one substring for another string in shell script
- Parsing JSON with Unix tools
- Bash scripting missing ‘]’
- Cannot use mkdir in home directory: permission denied (Linux Lubuntu)
- Using find command in bash script
- Return value in a Bash function
- Emulating a do-while loop in Bash
- How to change the output color of echo in Linux
- Recursively find all files that match a certain pattern
- Delete all local git branches
- How can I get the source directory of a Bash script from within the script itself?
- BASH Syntax error near unexpected token ‘done’
- bash assign default value
- What does -z mean in Bash?
- find: missing argument to -exec
- echo that outputs to stderr
- How to escape single quotes within single quoted strings
- Grep ‘binary file matches’. How to get normal grep output?
- Simple logical operators in Bash
- Bash if statement with multiple conditions throws an error
- Laravel PHP Command Not Found
- adb command not found
- Getting an “ambiguous redirect” error
- Bash syntax error: unexpected end of file
- How to convert a string to lower case in Bash?
- Binary Data Posting with curl
- How to use vim in the terminal?
- How to modify a global variable within a function in bash?
- How do I automatically restart a Minecraft Spigot server in the event of a crash or /stop when using screen?
- RE error: illegal byte sequence on Mac OS X
- How to specify the private SSH-key to use when executing shell command on Git?
- psql: command not found Mac
- How do I remove the file suffix and path portion from a path string in Bash?
- Sorting data based on second column of a file
- psql: FATAL: role “postgres” does not exist
- sed command with -i option failing on Mac, but works on Linux
- Using SED with wildcard
- Display current path in terminal only
- zip error – Nothing to do
- Run script on mac prompt “Permission denied”
- How to remove last n characters from a string in Bash?
- Meaning of “[: too many arguments” error from if [] (square brackets)
- Why does cURL return error “(23) Failed writing body”?
- Finding text inside a folder using terminal
- How to split one string into multiple strings separated by at least one space in bash shell?
- “Error installing rails” because “extconf.rb failed” on Ubuntu 18.04
- gdb debugging in Terminal OS X (10.8.5) with zsh
- Make a Bash alias that takes a parameter?
- Copy multiple files from one directory to another from Linux shell
- How to ssh from within a bash script?
- curl: no URL specified for restful api
- How can I do a recursive find/replace of a string with awk or sed?
- Running bash script from within python
- bash : cd : too many arguments
- Bash mkdir and subfolders
- How to open Emacs inside Bash
- Integer expression expected error in shell script
- Open Sublime Text from Terminal in macOS
- How to determine if a bash variable is empty?
- What is the difference between double and single square brackets in bash?
- How do I get the current Unix time in milliseconds in Bash?
- Run an interactive bash subshell with initial commands without returning to the (“super”) shell immediately
- How to make bash scripts print out every command before it executes?
- What does passing the -xe parameters to /bin/bash do
- How can I find the path to an executable in OSX