Questions tagged [command-line]

12877 questions
1

votes
2

answer
634

Views

Convert Jboss (WildFly) cli output to json in Ansible

I'm struggling to automate my deployment processes to WildFly over its cli. The cli itself don't work idempotent, so if I want to add using ansible for example some server properties it just threw an error in case it already exist (official cli documentation gives only 3 methods add, read, remove ht...
1

votes
1

answer
407

Views

Add GCP credentials to airflow via command line

Airflow allows us to add connection information via command-line airflow connections. This can help with automated deployment of airflow installations via ansible or other dev-ops tools. It is unclear how connections to google cloud platform (service accounts) can be added to ariflow via command lin...
Sebastian
1

votes
2

answer
334

Views

npm sub script with command line parameters

I have some npm scripts that look like this: 'scripts': { 'exec:dev': 'export NODE_ENV=development && npm run exec', 'exec:stage': 'export NODE_ENV=stage && npm run exec', 'exec:prod': 'export NODE_ENV=production && npm run exec', 'exec': 'node myapp.js' } I'd like to pass some command line argument...
d512
1

votes
1

answer
489

Views

What TCP port number does the aws cli s3 use?

When you upload or download files via aws cli, what TCP port number does it use over the internet?
Abel Callejo
1

votes
1

answer
115

Views

How to create a React app directly in the current folder

I know I've done it before but I can't seem to find the answer anywhere. I want to run create-react-app without creating a whole other folder within the folder I'm already in. I believe it is just an additional flag appended to the command.
Niko Roberts
4

votes
3

answer
113

Views

How can I get the CPU usage of a process with “tasklist” in Windows

I am writing a program in Java to periodically display the CPU and memory usage of a given process ID. My implementation invokes tasklist. It is pretty straightforward to get the memory usage by the following command: tasklist /fi 'memusage ge 0' /fi 'pid eq 2076' /v This will return the memory usag...
JakeSmitch
0

votes
1

answer
14

Views

python ModuleNotFoundError: No module named 'gplearn'

I created a project in Pycharm including a gp.py, copied the project folder to another machine and tried to run the gp.py script from command line using python gp.py. However I got a error Traceback (most recent call last): File 'gp.py', line 2, in from gplearn.genetic import SymbolicRegressor Mod...
user3474606
1

votes
3

answer
3k

Views

how to parse a boolean argument in a script?

The following function and usage examples illustrate exactly what I need with this usage: test([{True | False}]): >>> def test(arg=True): ... if arg: ... print 'argument is true' ... else: ... print 'argument is false' ... >>> test() argument is true >>> test(True) argument i...
Joel Daroussin
1

votes
1

answer
1.8k

Views

MySQL Commands not working on Windows CMD

I have a problem with my MySQL setup on Windows. First of all I downloaded the latest Windows Installer from dev.mysql.com and installed the server. Now when I am trying to execute MySQL commands in the cmd (I already modified the PATH variable, and I am logged in as MySQL root user) the command won...
nor0x
-1

votes
1

answer
34

Views

How to run .exe Command-line program from C# without “Access denied”?

I would like to run command line .exe file in C#. It works well if I run without C# as following: 1.I open cmd.exe without administrator rights, by one click. 2.Go to directory: cd C:\libs\windows 3.Execute the .exe file (bff-command-line is exe file): bff-command-line in.obj out9.obj But I would li...
Petras Vestartas
1

votes
3

answer
79

Views

Replace text in every command-line argument, and pass it to another command

I have a big project I want to compile, but it uses some g++ flags that I don't want to use. Instead of editing Makefiles, I thought about writing small script, that would run be instead of compiler, process command line arguments and pass them to compiler. #!/bin/bash ~/g++ `echo '[email protected]' | sed 's/-Os/...
m132
1

votes
2

answer
2.4k

Views

How to uninstall sample data from Magento 2 using CLI?

I have installed sample data in magento 2, due to power failures of system its stop in between. Later I saw, there were showing all categories and Products almost installed. But at home page not seem any banner or product sliders. I tried to install it again but it shown message associated email is...
Praful Rajput
1

votes
1

answer
178

Views

node js: I to get the output of an (child) exec and set a variable to be retuned?

I have been searching for a truly example, but I could not find any. I m fully new to node js. I am setting up a service which gets passwords using a command line tool. The command line 'pw get key' returns the password associated with the key. The command line 'pw set key password' sets the passwor...
mariotti
0

votes
2

answer
15

Views

Case insensitive search between two strings in file

I have a file constructed the following way: # comment with keyword One some code here and some more code # another comment with keyword Two some code # more comments and keyword Three lots of code I'm trying to extract the comments and corresponding code lines given a keyword, in a case-insensitive...
marshmcintire
1

votes
1

answer
387

Views

Equivalent of Stata tab command in R

I'm trying to find out what the Stata command tab x y if z>1 would be in R. Other than d %>% filter (z>1).
Rafael Sr
1

votes
2

answer
134

Views

Reading data from CSV File and Inserting it into Database

I have a requirement to read the data from a csv file and populate it into the database. I am using the bcp commandline utility for this purpose. My CSV File look like this: First_name,Last_name,EmpID,company,languages 'Jack','Thomas','57616','IBM','C C++ JAVA COBOL PERL SQL ' 'Tim','Cook','10001',...
Abhishek Pandey
1

votes
1

answer
37

Views

Exporting Folder Structure & Subdirectories/files to text

I am trying to export the folder structure and it's files of my portable hard drive to a text file to have offsite access. I want to be able to copy the folder structure of my Music folder (100 GB+) to a text file including the files within the nested folders. Note: I only want to copy the structure...
Desmond Smith
1

votes
1

answer
47

Views

How to get the program name in an escript program?

I have an Erlang program meant to be run using escript: % filename: myscript.erl -export([main/1]). main(Args) -> io:format('Args: ~p~n', [Args]). When I run escript myscript.erl 123 456, this is printed: Args: ['123','456'] This is good, but where is the name of the program (i.e. myscript.erl)? In...
Flux
1

votes
1

answer
33

Views

Certain Docker Commands not working in Windows Powershell ISE but working in other Command Line tools

I am exploring docker and I've been using Windows Powershell ISE to run docker commands. I have come across situation where I run certain commands in Powershell but they appear to be stuck, but when I run the same docker command on Command Prompt they work fine. I am using the same machine but diffe...
Sharingan
1

votes
2

answer
113

Views

Optimized way to calculate time duration in BASH

I am using below function that I wrote in BASH to calculate time duration and decide if the duration is more than 5 minutes it returns yes,otherwise no. It is working as expected but the files I am processing are huge (millions of lines) and it takes very long time to finish the job. I am looking fo...
Ibraheem
1

votes
1

answer
39

Views

Parsing command-line arguments without ignoring backslash

I need to take the first element of ARGV and save it as my template for searching through files. This element contains a backslash / but when I save it in a variable, the backslash disappears: my $template = $ARGV[0]; print $template; prints out GGCC, while the first argument is GG\CC. How can I get...
1

votes
1

answer
31

Views

What is /w 1 and /C in PowerShell command?

I've seen PowerShell commands that start powershell /w 1 /C ...some command here.... What are the /w and /C arguments? Is there some documentation for this? Googling it didn't return anything that seemed relevant.
Nicole
1

votes
2

answer
4.6k

Views

How to add custom HTTP Headers to IIS from the command line

We have an ASP.NET application and I need to add a custom HTTP header to IIS for all the developers on the team, so I want to add a command in the NANT script that will add the HTTP Header when the build script is run. Is it even possible to do this from the command line. I've been looking up the...
Glenn Slaven
-1

votes
0

answer
11

Views

Is there a way to run a command line as admin without any password?

I'm trying to change writable files to read-only from c++ code. The location of the files are under c:\program files, therefore it requires administrator privileges. The current user is in the administrator group. I tried many ways that work only if I open the visual studio as admin. for example: a...
coral
1

votes
1

answer
6.6k

Views

Using Apache common-cli to parse arguments

Apache common-cli has a example on its web site for ls command: options.addOption( 'a', 'all', false, 'do not hide entries starting with .' ); options.addOption( 'A', 'almost-all', false, 'do not list implied . and ..' ); options.addOption( 'b', 'escape', false, 'print octal escapes for nongraphic '...
Majid Azimi
1

votes
0

answer
37

Views

Windows - Virtually consolidating files from several directories into a single path

I have been searching for this for a while but no success yet. Not sure if I'm using the right terms... I'm trying to programmatically automatize the use of an API (from a software called Pix4D) to which I need to pass a directory path as one of the parameters. This directory is supposed to contain...
F Urzedo
1

votes
1

answer
23

Views

in the pager less, how to center the current line on the screen

I am using the pager less. How to center the current line on the screen? I cannot find such a centering command.
FunkyBaby
1

votes
1

answer
155

Views

import cv2 terminal error - python

I'm trying to simply install and use cv2, numpy and matplotlib. All installed successfully but when I type into the terminal 'import ...' it gives me the following error? I'm confused because what the terminal is suggesting, I've already installed it that way? I'm not sure about why it's pointin...
BBKING
1

votes
1

answer
55

Views

Check if an argument passed to a bash script is a file of a certain extension

I would like to check if the number of command line arguments passed to a bash script equals to one the argument points to an existing file the argument ends with .epub (in other words, the file has .epub extension) I have already dealt with the first and second requirement but I cannot deal with th...
menteith
1

votes
1

answer
27

Views

Command line arguments to get total errors during compilation in gcc compiler

Is there any command line argument to list the total number of errors in the particular compilation. This would be useful when solving a hell lot of errors or when the sources are large in number. IDE's like Eclipse used to list the total number of errors and warnings.
iamnagaky
1

votes
1

answer
110

Views

ARMv7 Assembly - Read from file and command line

I am having a problem reading some arguments from the command line when I call the program. I need to call it using ./try number string, for example: ./try 0 dfjjg When I run it I get a bus error. Can anybody help me? I'm new to assembly and it's pretty hard thanks a lot! .data .balign 4 file_opera...
Emil Popescu
1

votes
1

answer
37

Views

How can I pass a list of image names from a csv file to the find command?

So I have a csv file with a list of image names formatted as such: FPC-84WB.jpg Arctic-Blue.jpg Azuria.jpg Azuria-Reflective.jpg BLACK-REFLECTIVE.jpg Bronze.jpg Champagne.jpg Copper.jpg Light-Green.jpg Orange.jpg Pacific-Blue.jpg .... last-image.jpg I want to use find /var/www/html/ -name [name of i...
Nate Swanson
1

votes
1

answer
42

Views

Is there a way to programatically pull the sprint number from JIRA from CLI or Groovy?

I want to automate our build so that we usually don't have to fiddle with our versions. Our versions follow the format: ${YY}.${Quarter}.${Sprint}.${patch} Seems like I should be able to reach out to JIRA and grab that sprint number.
user447607
1

votes
1

answer
15

Views

What is the windows command line command for opening a program after a certain amount of time?

Say I want to open google in chrome, I know that I can use start chrome 'www.google.com', however, what if i want there to be a timer and this page to open after a certain amount of time?
seabiscuit24
1

votes
1

answer
565

Views

Constantly Running Python Script With User Input

I want to write a python command line script that will accept user input while simultaneously running another function or script at constant intervals. I have written some pseudo-code below to show what I am aiming for: def main(): threading.Timer(1.0, function_to_run_in_background).start() while Tr...
Skysmithio
1

votes
1

answer
115

Views

Codeigniter CLI does not log

I have the following function which updates the status of my vacancies (based on dates) and logs the amount of vacancies that got a change, it looks like this: //Function used to check the statusses of every vacancy and update it accordingly function checkVacanciesStatusses() { // this function can...
Dennis
1

votes
0

answer
239

Views

can not do “npm install -g composer-cli” in terminal Mac OS

my purpose: Install the CLI tools. enter link description here when I try to use this command :'npm install -g composer-cli'. I got this feeback: enter image description here my nvm version is 0.33.0. my npm version is 5.6.0. my Node version isv8.9.4 my Mac is Version is 10.12.6. Does any guru know...
DJ.Feng
1

votes
1

answer
49

Views

visually customizing Git Status output?

I was wondering if it was possible, to colorize a specific part of the git status message, specifically: your branch is ahead of ... by x commits Is that possible somehow?
Baumfrosch
1

votes
1

answer
110

Views

Trying to implement getopt in BATCH, with flagged arguments first and other arguments last

I'm trying to handle my script's command line arguments more elegantly. I really like the way getopt handles arguments in C, but at this point in my script it's not worth rewriting it in a new language. I came across this thread: https://stackoverflow.com/a/3661082, that included this method that I...
Robert Ellegate
1

votes
1

answer
2k

Views

UnrecognizedClientException error when authenticating on aws-cli

When I pull a clean Alphine Linux Docker image, install aws-cli on it and try to authenticate myself with aws ecr get-authorization-token --region eu-central-1 I keep getting the following error: An error occurred (UnrecognizedClientException) when calling the GetAuthorizationToken operation: The se...
cute_marmalade

View additional questions