command

How to paste into a terminal?

℡╲_俬逩灬. 提交于 2019-12-04 07:35:25
问题 I have copied a URL, such as git://gitorious.org/openhatch/oh-mainline.git . I want to paste this in the terminal using a keyboard shortcut. Please don't say "right click and paste." 回答1: Gnome terminal defaults to Control Shift v OSX terminal defaults to Command v . You can also use Command Control v to paste the text in escaped form. Windows 7 terminal defaults to Ctrl Shift Insert 回答2: Shift + Insert usually works throughout X11. 回答3: Mostly likely middle click your mouse. Or try Shift +

Why number 9 in kill -9 command in unix? [closed]

若如初见. 提交于 2019-12-04 07:34:00
问题 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 3 months ago . I understand it's off topic, I couldn't find anywhere online and I was thinking maybe programming gurus in the community might know this. I usually use kill -9 pid to kill the job. I always wondered the origin of 9. I looked it up online, and it says "9 Means KILL signal that is not catchable or ignorable. In

How to get all Windows service names starting with a common word?

五迷三道 提交于 2019-12-04 07:33:02
问题 There are some windows services hosted whose display name starts with a common name (here NATION). For example: NATION-CITY NATION-STATE NATION-Village Is there some command to get all the services like 'NATION-'. Finally I need to stop, start and restart such services using the command promt. 回答1: sc queryex type= service state= all | find /i "NATION" use /i for case insensitive search the white space after type= is deliberate and required 回答2: Using PowerShell, you can use the following Get

Linux - Replacing spaces in the file names

梦想的初衷 提交于 2019-12-04 07:22:10
问题 I have a number of files in a folder, and I want to replace every space character in all file names with underscores. How can I achieve this? 回答1: This should do it: for file in *; do mv "$file" `echo $file | tr ' ' '_'` ; done 回答2: I prefer to use the command 'rename', which takes Perl-style regexes: rename "s/ /_/g" * You can do a dry run with the -n flag: rename -n "s/ /_/g" * 回答3: Use sh... for i in *' '*; do mv "$i" `echo $i | sed -e 's/ /_/g'`; done If you want to try this out before

Broadcast command in discord.py

ぃ、小莉子 提交于 2019-12-04 06:54:29
问题 I am wanting to implement a cool broadcast command. The command will be like this. If an admin DMs the bot with $bc <whatever they want to type here> then the bot will then send that message to #broadcast . It can read from DMs and the server. I tried this command but it didn't work as I would have thought. @bot.command(pass_context=True) async def bc(args, message): channel = server.get_channel("474316889435275264") await bot.send_message(channel, args) It can't read any of the channel =

Symfony 2: Disable Doctrine event listener in ContainerAwareCommand

夙愿已清 提交于 2019-12-04 05:48:00
I am using several Doctrine listeners registered in configuration file for some automatic updates (created_on, updated_on timestamps etc.). Currently I have implemented additional functionality that requires stashing prepared values in the database for easier searching. I am thinking about update Symfony command that would prepare these values instead of SQL update script (actually any sort of change or update in the way the value is crated would than require just running this single command). However this would also trigger the EventListeners mentioned earlier. Is there a way how to disable

How to implement custom command line & execution

可紊 提交于 2019-12-04 05:25:02
问题 I'm trying to build a custom commandline for my app, i have several basic commands, and i simply use bunch of "if" statements to check what the command is. currently it looks something like this public void ExecuteCommand() { string input = ReadLine(); //gets last string from input bool isDone = false; //need bool to check whether command was executed or no, by default false. Match result = Regex.Match(input, @"([^\s]+)"); //to get command name string commandName = result.Value.ToLower();

How can I pipe input into a Java command from Perl?

二次信任 提交于 2019-12-04 05:19:04
I need to run a string through a Java program and then retrieve the output. The Java program accepts the string through standard input. The following works: my $output = `echo $string | java -jar java_program.jar`; There is one problem: $string could be just about anything. Any thoughts on a good solution to this problem? I suggest you to look at IPC::Run3 module. It uses very simple interface and allow to get STDERR and STDOUT . Here is small example: use IPC::Run3; ## store command output here my ($cmd_out, $cmd_err); my $cmd_input = "put your input string here"; run3([ 'java', '-jar', 'java

Create a single key-binding that fires a command every time control is pressed with any number and then passes the number as a parameter?

烂漫一生 提交于 2019-12-04 05:01:18
I need to create hot-keys for every control + number combination and would prefer not to have create ten commands. Is there any way to do this? If I understand your question, you have a single command, say MyCommand , and you want to fire it if the user presses CTRL+0 through CTRL+9, and give the command a different parameter for each combination. In that case, just create 10 key bindings in your window, all bound to MyCommand , and give them a parameter: <Window.InputBindings> <KeyBinding Command="MyCommand" Gesture="Ctrl+0" CommandParameter="0"/> <KeyBinding Command="MyCommand" Gesture="Ctrl

Calling SVN commands from a java program

故事扮演 提交于 2019-12-04 04:30:31
I want to call SVN commands (update , commit) from a java program. any help ? SVN : Tortoise SVN Environment : java program will be running inside a jBoss server. It's a really, really bad idea to use a GUI SVN client from within an app server. While TortoiseSVN can be scripted , it's still a GUI application, and an unexpected situation can cause it to pop up a dialog on your server (and some tasks may always open a dialog). It,s much, much better ot use a Java implementation of SVN, such as SvnKit - then you can work with a nice Java API and your question becomes moot. Sure, there are several