terminal

How to make a permanent zsh alias in command-line?

我们两清 提交于 2021-02-20 04:09:05
问题 I want to permanently store zsh aliases. When I make an alias and shut down ITerm and reopen and it's gone! alias mkcd="function _mkcd(){mkdir "$1"; cd "$1"} _mkcd" mkcd Ken zsh: command not found: mkcd How can I make it permanent? 回答1: Create a file .zshrc in your home directory if it does not exist already and add the alias to the file. Next time when you open the terminal. It will be available. To use it in the same session, just source the .zshrc file by running the command . .zshrc from

How to make a permanent zsh alias in command-line?

会有一股神秘感。 提交于 2021-02-20 04:08:10
问题 I want to permanently store zsh aliases. When I make an alias and shut down ITerm and reopen and it's gone! alias mkcd="function _mkcd(){mkdir "$1"; cd "$1"} _mkcd" mkcd Ken zsh: command not found: mkcd How can I make it permanent? 回答1: Create a file .zshrc in your home directory if it does not exist already and add the alias to the file. Next time when you open the terminal. It will be available. To use it in the same session, just source the .zshrc file by running the command . .zshrc from

Running java class from terminal

梦想与她 提交于 2021-02-19 04:47:12
问题 This question has been asked before but I still cannot figure whats wrong for some reason. I got a class named NewClass in package syntaxtest in file src. From src path I type : javac src/syntaxtest/NewClass.java and the class is compiled and I can see NewClass.class in syntaxtest folder. Now from that same path or even the same folder with NewClass.class, I can't figure out how to run the class from terminal. I have made many different attempts but ether I get ClassDefNotFound or

Is there “oldline” character in Java?

偶尔善良 提交于 2021-02-19 02:47:06
问题 Is there exist the opposite to the newline '\n' character in Java which will move back to the previous line in the console? 回答1: ASCII doesn't standardize a "line starve" or reverse line feed control character. Some character based terminals/terminal emulators recognize control code sequences that move the cursor up a line; these aren't Java-specific, and depend on your OS and configuration. Here's a starting point if you're using Linux: http://www.kernel.org/doc/man-pages/online/pages/man4

Integrated terminal in visual studio code is opening externally and not internally

让人想犯罪 __ 提交于 2021-02-19 01:52:08
问题 I have reinstalled Visual Studio Code and for some reason, when I do the Ctrl + Shift + ` shortcut, instead of opening a terminal window inside VS Code, it's opening an external command window, which is very annoying. Anyone knows what setting it is to get it back internally? I tried File->Preferences->Settings->Terminal and then set the first option "Customizes what kind of terminal to launch." to integrated. Is there any other setting I need to set? 回答1: Happened the same with me. It was

gcloud command not found -installing Google Cloud SDK

老子叫甜甜 提交于 2021-02-19 01:52:06
问题 I am trying to install the Google Cloud SDK on Mac using the following command in terminal curl https://sdk.cloud.google.com | bash It worked fine but when I move to the next step of gcloud init I get the following -bash: gcloud: command not found I have tried all solutions to the same question as in here, however I still get the same error message. The installer didn't prompt me with the following message either: Modify profile to update your $PATH and enable bash completion? (Y/n)? 回答1: The

Integrated terminal in visual studio code is opening externally and not internally

浪子不回头ぞ 提交于 2021-02-19 01:52:05
问题 I have reinstalled Visual Studio Code and for some reason, when I do the Ctrl + Shift + ` shortcut, instead of opening a terminal window inside VS Code, it's opening an external command window, which is very annoying. Anyone knows what setting it is to get it back internally? I tried File->Preferences->Settings->Terminal and then set the first option "Customizes what kind of terminal to launch." to integrated. Is there any other setting I need to set? 回答1: Happened the same with me. It was

.profile not working from terminal in mac

荒凉一梦 提交于 2021-02-18 08:54:18
问题 I had a .profile file that I was reading and using aliases from in my terminal, but at some point the aliases stopped working for no clear reason (other commands were still working). Thinking to make a quick fix, I deleted (rm) and recreated my .profile file in my user directory. There are no bash_profiles or others in existence that I can see, at leasts in that directory. The new .profile did not work. I tried restarting the terminal and the computer. Now, the commands that worked in the

How to colorize the output of Python errors in the Gnome terminal?

隐身守侯 提交于 2021-02-18 00:53:21
问题 Note: I am asking this question after researching how to actually do it. Other questions which are somewhat similar, but actually differ from my question relate to: Color-coding within the python script Importing color libraries within the script Using tools like Solarized to improve tools like Vim to color-code python code. What I am looking for: I already have a simple python script (say, test.py) and I am executing it from the Gnome terminal. python test.py test.py will output some errors

Bash command to calculate average on each row and each column

爷,独闯天下 提交于 2021-02-17 07:14:48
问题 Suppose we have a log file like marks.log and the content looks something like this: Fname Lname Net Algo Jack Miller 15 20 John Compton 12 20 Susan Wilson 13 19 I want to add a new column that contains average for each person, and a new row that contains average for each course. The result has to look like this: Fname Lname Net Algo Avg Jack Miller 15 20 17.5 John Compton 12 20 16 Susan Wilson 13 19 16 Average 13.3 19.6 - 回答1: If your data is in datafile.txt , the syntax for awk could be