Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I'm watching a video course on bash programming and the lecturer is constantly switching back and forth between his instance of the vi text editor and the command line by exiting out of vi and coming back in using this command: !vi. What I'm able to infer from this is that it probably means open vi along with the last file that was in the process of editing before vi was closed, but when I try doing that in my command line, that's not what happens. Vi just opens up with its welcome message.
In Bash, !vi expands to the most recent command starting with "vi". See History Expansion in the Bash manual.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I am using Terminal on MacOS. My main concern is that I’m commonly seeing command lines starting with the ‘$’ sign.
My command lines begins with a ‘%’ sign. Does this matter? If so, what is the reason?
The reason is that bash is no longer the default shell in macos. The default shell is now zsh which has certain advantages, such as floating-point operators.
You may set the Terminal default shell back to bash if needed. It's path is simply /bin/bash
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
When I'm in the terminal, I find myself writing a bash command and then I remember that I had to use another command first.
Example:
user$ python manage.py runserv...
and I remembered that I had to use
pip install -r requirements.txt
first for any new package.
Is it possible to run it without having to erase my first still incomplete command?
Thanks
Use ctrl+a to go to the beginning of the line, then ctrl+k to yank your current line to the cut buffer.
Run your new command, then press ctrl+y to "yank" the text back out, inserting it at the current cursor position.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Look at this incredible screenshot. I’m editing a commit message in Nano, within iTerm (an OS X terminal). I had just pulled changes from the master branch at git#github.com:Compass/compass.git
Please note how all the capital letters display fine, but no lowercase letters do!
This persisted even after I closed Nano. I had to close the terminal tab.
My question is… how is that possible? What "feature" of which software does this?
These are VT100 line drawing characters.
You can reproduce it with echo -e '\033(0' and exit the mode with echo -e '\033(B'.
Alternatively, reset will reset the terminal and go back to normal.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I have realized that when I log out from the computer, the Command Prompt history gets deleted (or at least when I press the arrow keys (or F7) nothing appears. How I can set the command promt to not to delete my command history.
There isn't an option to do so. However, you can use clink which has that feature (although it comes with readline-style line editing and several other bash-isms that might not be wanted or needed).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
When you are in Terminal, you are greeted with a prompt saying:
computer_name:~ directory user$ (command input)
Then if you use the command "bash", the prompt changes to:
bash-3.2$ (command input)
Now I understand that when you use a command like "python", you are taken into the Python interpreter, but it seems like pretty much all the same commands as usual work when you switch to Bash. Could someone explain what (if anything) is happening here?
When you type bash you are taken into a new Bash instance. If you press Ctrl + D you will exit. OSX uses Bash as default shell.