terminal

How to run Solr Jetty in background

你说的曾经没有我的故事 提交于 2019-12-20 09:59:45
问题 I am using the Jetty/Solr build that comes with Solr and would like to run it in the background instead of in the terminal. Right now I start it by java -jar start.jar but I would like it to log to a file and run in the background on the server so that I can close the terminal window. I'm sure there is some java config that I can't find. I have tried java -jar start.jar > log.txt & but no luck still outputs to the terminal window. Thanks. 回答1: Try something like: nohup yourcommand > output

With $TERM='screen-256color' under tmux, HOME and END keys don't work. Why?

有些话、适合烂在心里 提交于 2019-12-20 09:49:28
问题 I have tmux set up with $TERM being set to screen-256color correctly. This works fine, and colours are set correctly, however it prevents me from sending HOME and END keys to the terminal, which are instead printed as F\n and H\n . I should add that home appears to work in irssi, but not vim. Home seems to send (According to Ctrl+v <HOME> ), ^[OH It may be worth adding that I am well aware of the ability to use ^ and $ to move to the start and end of the lines, however $ does not go to the

How to run mysql command on bash?

时光总嘲笑我的痴心妄想 提交于 2019-12-20 09:47:52
问题 The following code works on the command line mysql --user='myusername' --password='mypassword' --database='mydatabase' --execute='DROP DATABASE myusername; CREATE DATABASE mydatabase;' However, it doesnt work on bash file on excecution #!/bin/bash user=myusername password=mypassword database=mydatabase mysql --user='$user' --password='$password' --database='$database' --execute='DROP DATABASE $user; CREATE DATABASE $database;' I receive the following error: ERROR 1045 (28000): Access denied

How to dump part of binary file

百般思念 提交于 2019-12-20 09:39:32
问题 I have binary and want to extract part of it, starting from know byte string (i.e. FF D8 FF D0) and ending with known byte string (AF FF D9) In the past I've used dd to cut part of binary file from beginning/ending but this command doesn't seem to support what I ask. What tool on terminal can do this? 回答1: In a single pipe: xxd -c1 -p file | awk -v b="ffd8ffd0" -v e="aaffd9" ' found == 1 { print $0 str = str $0 if (str == e) {found = 0; exit} if (length(str) == length(e)) str = substr(str, 3)

How do I change the directory in Git Bash with Git for Windows?

微笑、不失礼 提交于 2019-12-20 09:36:47
问题 How would I change to the directory C:/Users/myname/project name in Git Bash? 回答1: cd /c/users/myname/project\ name Beware that ls / , or typing cd / followed by Tab-completion, might not show the existence of this folder, but cd /c will still work. Also note that pwd (to print the current working directory) might show something like /bin , but this might not be the actual working folder for commands such as git clone , which might use the folder from which Git Bash was started. 回答2: If the

Copy and paste in vim via keyboard between different mac terminals?

梦想与她 提交于 2019-12-20 09:19:09
问题 Can anyone help me with this: I'm trying to figure out how to copy and paste text between 2 different instances of vim on different terminals (using iterm2 or mac terminal). I can do it using the mouse if I do ":set mouse=a" but I'd like to be able to do it using the keyboard. I've googled around and it says you can use the "* or "+ registers to copy/paste to/from the system clipboard, but when I type * or + in vim, the mac makes one of those sounds it makes when you can't do something. I've

Count number of specific file type of a directory and its sub dir in mac

五迷三道 提交于 2019-12-20 09:11:29
问题 I use ls -l *.filetype | wc -l but it can only find files in current directory. How can I also count all files with specific extension in its sub dirs? Thank you very much. 回答1: You can do that with find command: find . -name "*.filetype" | wc -l 回答2: The following compound command, albeit somewhat verbose, guarantees an accurate count because it handles filenames that contain newlines correctly: total=0; while read -rd ''; do ((total++)); done < <(find . -name "*.filetype" -print0) && echo "

How do i access mysql from mac terminal, using xampp?

久未见 提交于 2019-12-20 09:06:11
问题 I am trying to access mysql from my mac's terminal. I have tried just typing mysql -u root -p (and Enter, but that does not exist..) This is what i have managed to do/located so far: Williams-iMac:mysql noName$ cd /Applications/xampp/xamppfiles/var/mysql/mysql Williams-iMac:mysql noName$ ls This is what is located there. columns_priv.MYD help_relation.frm slow_log.CSV columns_priv.MYI help_topic.MYD slow_log.frm columns_priv.frm help_topic.MYI tables_priv.MYD db.MYD help_topic.frm tables_priv

How to run a script as root on Mac OS X? [closed]

别说谁变了你拦得住时间么 提交于 2019-12-20 08:48:24
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 8 years ago . What should I type on the Mac OS X terminal to run a script as root? 回答1: As in any unix-based environment, you can use the sudo command: $ sudo script-name It will ask for your password (your own, not a separate root password). 回答2: Or you can access root terminal by typing sudo -s 回答3: In order for sudo to

How to run a script as root on Mac OS X? [closed]

拟墨画扇 提交于 2019-12-20 08:48:13
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 8 years ago . What should I type on the Mac OS X terminal to run a script as root? 回答1: As in any unix-based environment, you can use the sudo command: $ sudo script-name It will ask for your password (your own, not a separate root password). 回答2: Or you can access root terminal by typing sudo -s 回答3: In order for sudo to