FAQ Database Discussion Community


Gnuplot command with multiple “with” arguments

command-line,plot,gnuplot
Plotting in Gnuplot: For example if one tries to both set the datapoint type and the errorbars into one command, there's a conflict of "with" arguments, i.e.: plot "test.csv" using 1:2:3 with points pointtype 5 with yerrorbars The error message is as follows: duplicated or contradicting arguments in plot options....

Error while executing batch file

windows,batch-file,command-line
This is my first time creating a batch file. I am trying to execute by adding all the following inside a batch file. however the flow stops at the for loop. these command works when directly executed on command prompt. And I am also facing error with the copy command...

Is it possible to store a deferred command execution in a bash variable?

bash,shell,command-line
I have already looked deferred variable expansion but that does not appear to work for the problem here, unless I have misunderstood it. I want to create a shell variable which always evaluates to the current time in a particular format. Here is my first attempt. foo=$(date +'%H-%M-%S') Unfortunately, this...

How to create a new file where each new line contains some text and quoted line/step number?

shell,unix,command-line,awk
I want to use a loop while creating a new file where each new line is created by one/single step: some text, then quoted step number, and then something else. I started with this code, but it does not work: gawk ' { for (i = 1; i <= 1000;...

How to execute unionBugs and convertXmlToText (Findbugs) from the command line on Windows

windows,command-line,findbugs
I'd like to run some of the data mining techniques discussed on this page: http://findbugs.sourceforge.net/manual/datamining.html#unionBugs via the command line on Windows. I've searched all over for examples, but nothing has shown me the syntax required. I've run Findbugs plenty of times using java -jar %FINDBUGS_HOME%\lib\findbugs.jar, but can't get the data...

If exist and errorlevels in a batch (.bat) file

windows,batch-file,command-line
I'm trying to run a delete command on the result of an SQL command but only if it returns an error code of 0. Below is my code: SqlCmd command... REM if SqlCmd command is successful run the below if exist statement if errorlevel 0 ( REM if the file...

Delete .DS_STORE files in current folder and all subfolders from command line on Mac

linux,osx,command-line
I understand I can use find . -name ".DS_STORE" to find all the .DS_STORE files in the current folder and all subfolders. But how could I delete them from command line simultaneously? I found it's really annoying to switch back and forth to all folders and delete it one by...

Recursively copy /dev/null to file pattern

linux,command-line,zfs
I am using a ZFS system that has reached its disk quota. As a result, the rm command no longer is available to me. However, I am able to copy /dev/null to particular files to effectively remove them. The issue is that the directory I am trying to clear out...

How do I ignore escape characters in command line arguments?

command-line,f#
Consider a simple F# console application that echoes the command line arguments passed to it, one command per line: [<EntryPoint>] let main argv = argv |> Array.iter (printfn "%s") 0 If I pass this program a directory path with a trailing slash, it treats the slash as an escape character...

Redirect stdout using exec in subscript

linux,bash,redirect,command-line,sh
I have one main script which is started as an service. I can't modify this main script, because it is often updated. This main script starts a program, which echo any log to stdout. So i can't see any log of this program. But this main script calls at the...

How do I remove a user in mongoDB from the terminal by username?

mongodb,command-line,meteor,user-accounts
My question is this: How can I remove a user from the users db by username, or at all even? I have a meteor application with a custom registration, and when an account is created you can login and manage your account and what have you.. My problem is that,...

How do I make findstr show the full file path inline?

command-line,path,grep,dos,findstr
When I use grep I get a list of matching results with the full file path for all the child subdirectories. When i do this with findstr - I don't get the inline results. My question is: How do I make findstr show the full file path inline?...

Trying to use cURL to access local Exchange server

curl,command-line,exchange-server,imap
I'm working on a project that involves a Microsoft Exchange 2013 mail server on my Windows Server 2012 machine. For the project, I need to send, read, and delete emails using cURL, preferably from the command line. The problem is, I'm having trouble connecting to the Exchange server with the...

IntelliJ command line compiler

java,command-line,intellij-idea,compiler-warnings,headless
I'm searching for an automated way to collect all the IntelliJ static code analysis warnings (compiler and inspections) without having to run a UI and click on buttons. Ideally I'd like run the IntelliJ compiler from the command line and have it log all warnings into a file. Is this...

How can I set position independent build setting using xcodebuild from the command line?

command-line,xcodebuild,build-settings
I'm working with some third party tools that generate xcode project files for a few subcomponents. Their tools generate the project files with Generate Position-Dependent Code set to YES (potentially because the tool generates project files for OS X builds too and the latest update has it confused). While I...

does a publicly available partial solution exist to parse *nix-style command line options without pre-knowledge of the keys? [closed]

linux,bash,shell,unix,command-line
does a publicly available partial solution exist (in any language) to parse *nix command line options into a data structure in the case where the option keys are not known in advance. basically, parse something like my-script -x ex --y=why zebra and get {'x': 'ex', 'y': 'why'} without knowing that...

Using a command-line utility to perform the following map-updates

shell,command-line,awk,terminal
I'm a complete newbie to using command-line utilities and am wondering how to process information as following: mapping.txt: 80 001 002 81 011 012 013 014 82 021 022 ... input.txt: 81 103823044 80 103823054 81 103823064 ... Desired output.txt: 103823044|011| 103823044|012| 103823044|013| 103823044|014| 103823054|001| 103823054|002| 103823064|011| 103823064|012| 103823064|013| 103823064|014|...

How do I make a tarball with winrar from command line

command-line,zip,winrar
This should be straight forward like it is with 7-zip, but it's not and google is not helping. I'm doing the following at the command line rar a -ep1 "C:\Mail\test.zip" "C:\Mail\LastEmail.txt" and it keeps creating "test.zip" in rar archive format. It needs to be in zip format. Ultimately I want...

Interactively merge files tracked with git and untracked local files

git,command-line,merge,diff,interactive
I use a couple of software packages (like gitlab) that you install by cloning from their git repo. They typically come with some config.example (under version control), which you copy to your own config file (not under version control or even ignored in .gitignore) and adapt to your needs. When...

AWK count number of times a term appear with respect to other columns

linux,shell,command-line,awk,sed
Given a CSV file: id, fruit, binary 1, apple, 1 2, orange, 0 3, pear, 1 4, apple, 0 5, peach, 0 6, apple, 1 How can i calculate for each unique values in fruit, the number of times the binary value =1 / number of occurences of that fruit...

How to set the classpath in Windows Command Line correctly

java,windows,command-line,classnotfoundexception
I have made many attempts to enter a command to run a JAR file correctly from the terminal, and I am 100% sure that all the JAR files and such are in the given paths, but I keep getting a ClassDefNotFoundException. Does it have anything to do with the way...

How to release binaries on Github for different plattforms as seperate downloads?

git,github,command-line,software-distribution
I found this at github https://github.com/blog/1547-release-your-software. Their page provide a way to attach binaries to a special release. My build script compiles binaries for Windows MacOS and Linux. How to supply seperate downloads for different platforms there? AS far I can see these releases are simple git tags. Is it...

Regex capture and replace %20 after last forward slash

regex,bash,perl,replace,command-line
I have a tsv file with a lot of HTML inside. I need to replace %20 after last forward slash of href attributes of non .jpg links. I'm trying with Perl on command line, I need help with the regex. I have tried some regex, this is in the live...

How to append suffix to all string matched regular expression in unix

unix,command-line,sed
I need to replace all occurrences of string in specific format (in my case colon followed by some number) with same string with suffix in a file, like this: :123456 -> :123456_suffix Is there a way to do it with sed or other unix command-line tool?...

What is this command doing? sed

linux,bash,command-line,sed
I was given a general set of commands used as an example for something I will have to perform: 1 cat /etc/dsh/machines.list | sed -e "s|\(.*\)|sshfs \1:/opt/dextor/cloud \1|" 2 cat /etc/dsh/machines.list | sed -e "s|\(.*\)|sshfs \1:/opt/dextor/cloud \1|" | sh 3 cat /etc/dsh/machines.list | sed -e "s|\(.*\)|cp run.sh \1/|" 4 cat...

How to install Visual Studio Gallery extensions from command line

visual-studio,command-line,nuget,visual-studio-gallery
TL;DR Is there a way to access Visual Studio Gallery from command line, similar to chocolatey? I am trying to configure a Visual Studio dev environment using Vagrant. Now, team members use various extensions available from Visual Studio Gallery and it would be great if they could script their installation...

Bash quotes disable escaping

linux,bash,command-line,escaping
I want to run some command, let's name it "test" from my bash script and put there some of params from bash variable. My script: #!/bin/bash -x PARAMS="-A 'Foo' -B 'Bar'" ./test $PARAMS I've got: + PARAMS='-A '\''Foo'\'' -B '\''Bar'\''' + ./test -A ''\''Foo'\''' -B ''\''Bar'\''' It's wrong! Another one...

c# - Reading commandline args with their associated values

c#,command-line,console-application,args,command-line-parsing
Was just wondering whether there is a way to read in commandlines in a console app with values. I can read in commandlines easily enough but can't seem to find any info about obtaining values from a commandline. For example(args): aTest = 5; bTest = 13; Would there be a...

Align rows in text file with command line

text,command-line
I have data in a text file where data rows are repeated after several columns and each new block shares the first column of row labels. I'd like to use the command line to get align the rows into a single table. The data text file looks like: Values SampleA...

Does command-line stop programs launched in command window when command window is closed?

java,windows,command-line
When launching and executable jar from the command window, is the jar attached to that window? So when I close the command line the program stops running, or will it continue in the background? If so, System.out.println() should that print to the command window open if I'd closed the first...

Cannot log WinZip command line process

logging,command-line,vbscript,zip,winzip
I got the following vbscript test code that zip some test files via WinZip Command Line: Dim strWinZipDir, strZipFileToCreate, strFilesToZip, strWinZip, strCommand strWinZipDir = "C:\Program Files\WinZip\Winzip32.exe" strZipFileToCreate = "C:\Users\ext_dirmod_01\Desktop\TestLog.zip" strFilesToZip = """C:\Users\ext_dirmod_01\Desktop\FacturasGRA.vbs"" ""C:\Users\ext_dirmod_01\Desktop\Test Zip Windows.vbs""" Set objFSO = CreateObject("Scripting.FileSystemObject") strWinZip = objFSO.GetFile(strWinZipDir).ShortPath strCommand = strWinzip & "...

Alias to “do X then ” transparently

linux,bash,command-line,alias,io-redirection
The title sucks but I'm not sure of the correct term for what I'm trying to do, if I knew that I'd probably have found the answer by now! The problem: Due to an over-zealous port scanner (customer's network monitor) and an overly simplistic telnet daemon (busybox linux) every time...

Split a text file if two consecutive lines almost identical

windows,batch-file,command-line,text-files
I need to split a text file (using a .bat command) based on the content of the string of the previous line (from position 2 to 13) and the content of the string of the current line (from position 2 to 13)... I explain: My file looks like that: IA1234567890A...

Trying to learn batch script, what does this do: /letter?

windows,batch-file,command-line,scripting,command-prompt
Here's the batch file: @echo off xcopy c:\testsource c:\testbackup /m /e /y So I know that "xcopy c:\testsource c:\testbackup" copies the files in the testsource directory and pastes them in the testbackup directory, but what does the "/m /e /y" do? Can you explain what each individual part of this...

Using the Rails console to delete odd-numbered records

ruby-on-rails-4,command-line,console
I'd like to delete records with odd numbered ID's from Hero table using the Rails console. Would someone be so kind as to suggest a way for me to do this? Kind Regards, Ryan...

shell script to capture string from a table

bash,shell,command-line
I am writing a shell script to upload a file to a specific folder on google drive. I have started out on the terminal though, to see how it can be done. $ now=$(date +"%Y") $ echo now 2015 $ drive list | grep -w $now 0B6g6AG_EmqeJM3ZKSHc5cUNJZ2M delete.txt 18.0 B...

Why is csc.exe crashing when I last left the output encoding as UTF8?

c#,windows,command-line,csc
I am having am having or have run into a very strange thing. I wonder if others have and why it's happening. Having run a one line program with this line System.Console.WriteLine(System.Console.OutputEncoding.EncodingName); I see the Encoding is Western European (DOS) Fine Here is a list of some codepages 1200 Unicode...

Gradle Assemble Debug is Successful But Does Not Work [duplicate]

android,command-line,gradle
This question already has an answer here: Why won't gradle run from within a jenkins job 2 answers After following instructions here: http://developer.android.com/tools/building/building-cmdline.html apparently you're supposed to chmod +x gradlew then ./gradlew assembleDebug which leads to the following output: /gradlew assembleDebug :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72200Library...

Node script executable not working on Mac : env: node\r: No such file or directory

node.js,command-line,osx-yosemite
I have created my node script executable to execute some tasks grunt. On Windows, my node script works fine. But on Mac OS X (Yosemite), it's not working. My node script has been published on Windows. My node script is installed via npm command : npm install -g task-app My...

Importing a mysql database with command line

mysql,linux,database,command-line,phpmyadmin
Have tried all other answers on stackoverflow, and they haven't worked. I have a database in phpMyAdmin, and I need to update it. The file is too big to upload via phpMyAdmin, and I've tried increasing limits in php.ini to no avail. I think that didn't work because I updated...

How do I silence the HEAD of a curl request while using the silent flag?

bash,shell,curl,command-line,pipe
When I run the curl command and direct the data to a file, I get back the content of the site as expected. $ curl "www.site.com" > file.txt $ head file.txt Top of site ... However, this command shows a progress bar, which I do not want: % Total %...

How to execute command line file on remote server?

linux,command-line,ssh
I have a staging script where I want to execute some operations on the remote machine. But when I use ssh ${REMOTEUSER}@${REMOTEHOST} the next line mkdir folderwon't work. The script stops and I end um in the Command Line of the remote server. How do I get the other commands...

Run function in script from command line (Node JS)

javascript,node.js,command-line
I'm writing a web app in Node. If I've got some JS file db.js with a function init in it how could I call that function from the command line?

Set Java path in command line for only one directory

java,command-line,command-prompt
I am running a program that utilizes Scala 2.10 for work and is not compatible with Java 8, only Java 7. In a Windows 7 command line, how can I set the java path to use Java 7 ONLY for that directory?

Unable to extract text and images from specific PDF

ruby,pdf,command-line,ubuntu-14.04,pdfbox
Can anyone please let me know how I can extract all the text and images from a PDF. I am able to extract images in scenario like, which I created a PDF with few lines of text and 2 png images using Google Docs. But, I am unable to extract...

Using shell command output within VI editor

shell,command-line,vi,shadow
I'm just walking my very first steps with vi-like editors and i would like to know if it's possible to insert the output of a shell command within a line when, for example, editing /etc/shadow with vipw -s prueba4::16586:0:99999:7::: ~ ~ ~ ~ ~ ~ ~ ~ ~ My goal...

The command “sudo apt-get install python-dev, python3-dev” failed and exited with 100 during

python,python-2.7,python-3.x,command-line,pip
It seems like sudo apt-get install build-essential worked just fine but, but it gets error while installing python-pip. Here's the log of the failed build....

Iterate over specific files in a directory using Bash find

bash,command-line,terminal
Shellcheck doesn't like my for over find loop in Bash. for f in $(find $src -maxdepth 1 -name '*.md'); do wc -w < "$f" >> $path/tmp.txt; done It suggests instead: 1 while IFS= read -r -d '' file 2 do 3 let count++ 4 echo "Playing file no. $count" 5...

Woes Compiling android Application by hand

java,android,windows,command-line
I am trying to compile my Android application by hand, using some details i found here: http://geosoft.no/development/android.html Everything works. I can now compile my own applications without the need of any tools except mine. This means no Gradle and no Android studio. It works flawless, except when I need to...

XSLT 2.0 in command line: Directory problems

xml,xslt,command-line
I have a XSL Stylesheet called "EAndSST2ARXML.xsl" in the XSLT/XSLT directory. I have several XML-Files to transform in the XSLT/InputFiles directory. The Output Files should be generated in the XSLT/OutputFiles directory. The Output files should have the same name as the input files, only the extension should change from .xml...

“URL GOTO” keeps looping from iMacros javascript

javascript,loops,firefox,command-line,imacros
I have two files in the folder ~/iMacros/Macros/ that are related. One is an imacro (TodaysEvents.iim) like below: VERSION BUILD=8920312 RECORDER=FX TAB T=1 URL GOTO=http://www.event.com/schedual SET !EXTRACT_TEST_POPUP NO SET !ERRORIGNORE YES TAG POS={{loop}} TYPE=A ATTR=TXT:02 EXTRACT=HTM SAVEAS TYPE=EXTRACT FOLDER=/root/Desktop FILE=TodaysEvents.csv TAB CLOSE And the other is a javascript file (TodaysEvents.js)...

Find all files contained into directory named

linux,bash,shell,command-line,find
I would like to recursively find all files contained into a directory that has name “name1” or name “name2” for instance: structure/of/dir/name1/file1.a structure/of/dir/name1/file2.b structure/of/dir/name1/file3.c structure/of/dir/name1/subfolder/file1s.a structure/of/dir/name1/subfolder/file2s.b structure/of/dir/name2/file1.a structure/of/dir/name2/file2.b structure/of/dir/name2/file3.c structure/of/dir/name2/subfolder/file1s.a structure/of/dir/name2/subfolder/file2s.b structure/of/dir/name3/name1.a ←this should not...

running testng.xml via command line- error Cannot find class in classpath: com.companyname.SSProject.LaunchSSProject

command-line,testng
I am using following command on command line: C:\Users\MyScriptDirectory>java -classpath ".;Lib\selenium-2.45.0\libs\testng-6.8.5.jar" org.testng.TestNG testng.xml Getting error message: [TestNG] [Error] Cannot find class in classpath: com.companyname.SSProject.LaunchSSProject I have made following entry in testng.xml: <class name="com.companyname.SSProject.LaunchSSProject" /> "com.companyname.SSProject" is my package having LaunchSSProject.java file inside it When I am running the same testng.xml...

How can I put a python program with multiple files in /usr/local/bin?

python,shell,command-line
I know that if my program were just one python script file, I could just start it with the shebang and put it in /usr/local/bin so that I could invoke it at any time from the command prompt. However, what if my program were multiple files, but I only want...

Git status showing weird untracked “path_of_file\r” files, how to remove by command line

c++,git,bash,command-line
I was in a C++ program with google unit test, gtest. I ran and built the projects. At the end, when I ran git status, it gave some weird untracked files. I do not know where they are from, and how I should remove them please. Using bash. > git...

Sudo chown mistake?

command-line,homebrew,chown
I have been trying to install Homebrew on my Mac but ran into permission problems since my user is not an administrator. I followed the suggestions here: http://stackoverflow.com/a/16450503/4909923 su -l admin sudo chown -R "$USER":admin /usr/local sudo chown -R $USER:admin /Library/Caches/Homebrew Now I'm concerned that I have wrongfully changed the...

How to specify CA private key password for client certificate creation using OpenSSL

command-line,openssl,x509,ca
I am building a command line script to create a client certificate using OpenSSL "mini CA" feature. I have a CA certificate and CA private key encrypted with a password. With those things I am trying to create the client certificate and stumbled upon the command line syntax. How do...

Calling a Powershell script with the “-command” parameter instead of “-file”

powershell,command-line,command-line-arguments
What is the difference between calling a powershell script like this: powershell.exe -file "myfile.ps1" and like this (which also works): powershell.exe -command "myfile.ps1" thanks, robert...

Set PATH when launching a new terminal from a script in Mac

osx,bash,command-line,terminal
I need to launch a new terminal window from a script and set an environment variable in this new terminal so I can run a few commands there. This is what I have so far: #!bin/bash PATH=$PATH:$1 open -a Terminal /my/path/ Notice $1 is a value I'm sending when running...

command line Start.Info.Argument error

c#,command-line,wix,heat
I would like run this command with C# : "%WIX%/bin/heat.exe" dir "C:\Documents and Settings\APP" -gg -sfrag -cg Appli -out wixappli.wxs I have this code (Program.cs) : System.Diagnostics.Process process1 = new System.Diagnostics.Process(); process1.StartInfo = new System.Diagnostics.ProcessStartInfo("cmd.exe"); process1.StartInfo.Arguments = String.Format("/k \"%WIX%/bin/heat.exe\" dir \"{0}\" -gg -sfrag -cg Appli -out wixappli.wxs ", @"C:\Documents and...

Continuous data stream from linux command line into python script

python,linux,command-line,tcp,pipe
I need to get a continuous stream of data flowing from a peripheral device, to a raspberry pi, and lastly to my computer (mac). So far, the data is can make its way continuously (in real time) from the peripheral, to the command line of my raspberry pi. Note that...

Calling a Scala program from command line

scala,command-line
I know it seems like a beginner question and that there are quite a lot of related questions, but I believe mine is a bit specific and I did not find the answer. My arborescence is the following : root jsoup-1.8.2.jar bin miscellaneous md2html.class The bin directory is the generated...

Python Command Line Arguments: Calling a function

python,command-line,command-line-arguments,argparse,optparse
So I'm stuck on a project I'm working on that involves the command line in python. So basically, here's what I'm trying to accomplish: I have a set of functions in a class, say, def do_option1(self, param1, param2) : #some python code here def do_option2(self, param1): #some python code here...

Create text file using echo in command prompt

command-line,command,echo,command-prompt
I'm creating a hello_world.txt in the desktop using echo in command prompt and this is my input. echo hello world > C:\Users\user\Desktop\hello_world.txt The first code works, then I try %userprofile% if example, I want to give it to another user. echo hello world > C:\Users\%userprofile%\Desktop\hello_world.txt Doesn't work. Any simple echo...

How to set env variable to the specific value out of multiple output values of some command?

batch-file,command-line
I'm using following command to find out the pid for some string e.g. myname. for /f "TOKENS=1" %a in ('wmic PROCESS where "commandline like '%myname%' and name ='java.exe'" get processid') do set myid=%a This command returns me below o/p. set myid=ProcessId set myid=1928 set myid= In the end it sets...

Gulp - TypeError: Cannot assign to read only property 'cwd' of bower / bootstrap.css

css,twitter-bootstrap,command-line,gulp,bower
I'm just getting to grips with Gulp.js and this is the only error I can't seem to get around. I have install bootstrap via bower, and I'm trying to minify the bootstrap css. Here's my gulp task; gulp.task('minifycss', function() { gulp.src('www/css/animate.css', 'www/bower_components/bootstrap/dist/css/bootstrap.css') .pipe(minifycss({compatibility: 'ie8'})) .pipe(gulp.dest('www-deploy/css/')); }); However when I run...

cat /dev/null to multiple files to clear existing files like logs

linux,bash,shell,command-line,tee
A good way to clear logs(syslog has a handle on file) which have frozen my linux server(out of space) I tried cat /dev/null > fileABC; cat /dev/null/ > fileXYZ How can I clear multiple files by cat /dev/null to multiple files in an efficient or single command. ...

How to stop seeing 'answer=' after I run a function y=f(x)

matlab,command-line
Sometimes, I write a matlab program, say y=f(x), and then put semicolon everywhere necessary to purposefully stop seeing any output at all. However, even though, an output 'ans=...' appears in my command window. This ... is the final value of y at the end of a loop etc. Why is...

What does this command mean in Linux? [closed]

unix,command-line
What does this command mean in Unix anyone? ls 2> result? And what will the contents of result be after running the above command? I currently know ls is to list all files in the current directory and result is the program file, but I have no idea what 2>...

Remove GIT conflict markers in command line

linux,git,command-line
I would like to know if it's possible with one or more Linux command to remove the markers <<<<<<< HEAD ... ======= ... >>>>>>> master from a GIT conflict automatically. This is the the only way to keep BOTH changes, I suppose. And no, the order doesn't really matter for...

vbscript to run command

command-line,vbscript
I'm trying to create a script that runs the command: RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255 Right now this errors out Dim objShell Set objShell = Wscript.CreateObject("WScript.Shell") sEXE = """C:\Windows\system32\RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255 """ with CreateObject("WScript.Shell") .Run sEXE & " " , 1, true end with Wscript.Quit Any suggestions? Could I make the script...

Running Rscript in command line and loading packages

r,command-line,packages,rscript
I have a foo.R file which contains library("ggplot2") cat("Its working") I am trying to run foo.r via the command line using the Rscript commandRscript --default-packages=ggplot2 foo.R and it is giving me the following error: 1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : there is no...

When to use quotes in command line? cp versus find

command-line,terminal,quotes,double-quotes,cp
I'm wondering if there is some pattern or trick to remember when or when not to use quotes in command line arguments. e.g. what is the difference between: find -type f -name "*<extension-with-quotes>" and cp <extension-without-quotes> ../<new-folder> One needs quotes and one does not, else it gives an error. Why?...

Catch result of process from exe (right click context)

batch-file,command-line,cmd,registry,right-click
I wrote following reg file inorder to delete files/folders securely. Cmd working as expected. But sometimes I would like to see result of it (I do not want to disappare of cmd window) How can I pause / wait / stop before windows disappared "D:\Desktop\_NotUse\SDelete\sdelete.exe -s -p 5 \"%1\"" /pause...

Is there a Byte Offset in FFmpeg for source Files?

c++,command-line,ffmpeg,offset
I am working on an C++ Application (running on Ubuntu) that opens FFmpeg for video conversion and reads the output through popen(). This works fine but now i need FFmpeg to start reading the source File at a specific Byte Offset. Is there any way to archive this? I already...

Command Line: manipulating file names; grep?

command-line,grep,renaming
I currently have a directory of files with date based names in the format mmddyy: nxd060815a.html nxd060915a.html nxd061015a.html and would like to change file name format to yyyy-mm-dd: nxd2015-06-08a.html nxd2015-06-09a.html nxd2015-06-10a.html How would I do this from the command line? Any help is appreciated....

Reading from linux command line with Python

python,linux,shell,command-line
Is there a way to read data that is coming into the command-line, straight into another Python script for execution?

prevent space from splitting filenames using backticks

linux,command-line
Using find to select files to pass to another command using backticks/backquotes, I've noted that filenames that contain spaces will be split, and therfore not found. Is it possible to avoid this behaviour? The command I issued looks like this wc `find . -name '*.txt'` but for example when there...

How to uninstall a program using C#? [duplicate]

c#,visual-studio,visual-studio-2012,command-line,windows-installer
This question already has an answer here: How to uninstall MSI using its Product Code in c# 4 answers I'm trying to uninstall a program using C# via Visual Studio and possibly CMD. I made several attempts but could not getting anything to go. Attempt #1: RegistryKey localMachine =...

Get the output from executed commands through android app

java,android,linux,command-line,root
I'm performing the following code to execute linux commands in my android application that I'm creating: public void RunAsRoot(String[] cmds){ Process p = Runtime.getRuntime().exec("su"); DataOutputStream os = new DataOutputStream(p.getOutputStream()); for (String tmpCmd : cmds) { os.writeBytes(tmpCmd+"\n"); } os.writeBytes("exit\n"); os.flush(); } I want to know if there is a way to...

What is the difference between “echo” and “echo -n”?

bash,command-line,echo,osx-mavericks
The manual page on Terminal for echo -n is the following: -n Do not print the trailing newline character. This may also be achieved by appending `\c' to the end of the string, as is done by iBCS2 compatible systems. Note that this option as well as the effect of...

How to compose Python exe programs using pipes?

python,python-2.7,batch-file,command-line,pipe
Python newbie here. I created a Python program, msg.py, which outputs a message (Hello, World). I created a Python program, id.py, which reads input and outputs it. Using py2exe I created an executable of each of them: msg.exe and id.exe I created a DOS batch file, set PATH to the...

How do I copy the directory and its folders in windows command line?

windows,command-line
Windows environment: I am having some difficulties with doing what I expected to be rather simple. I have for the past 2 hours been unable to copy a directory and its files and sub-directories to another location. e.g.: I have Directory MyDir with files 01.txt 02.txt and a Sub-Directory MyDir2...

How to find the non space version of a file name with spaces

windows,command-line
I am using windows and need to access a directory and file name that contains spaces. Right clicking the file and choosing properties use to show the non space short name, but it seems windows 7 no longer does this. I'm also at work so I can't install dosbox. I'm...

diff: Only compare files and ignore subdirectories

linux,bash,shell,command-line,diff
I'm trying to compare two directories, each with some files and a subdirectory. Is there any way to run diff on these two folders, but not run it on the subdirectory? I've tried using diff -x'*/' foo bar, as well as a couple variants with backslashes to escape them, but...

loading .sql file using command line

mysql,sql,command-line
I tried to load code examples from http://examples.oreilly.com/9780596527082/. This approach don't work for me: Limbs.sql can be found in recipies/tables (this is example from book). I work on ver. 5.6.24 (localhost) and Windows 7....

Replying to Tweets Using t for the Command Line

ruby,twitter,command-line,awk
I'm using t for Ruby to tweet from Terminal. I want to be able to scan my timeline, find the tweet IDs then reply to them. The closest I've got is this command that doesn't work. The issue is that the reply command takes two arguments, an ID and a...

perl regex find and replace with variable from bash

regex,bash,perl,command-line
I have this regex: 'src=\d' which match all src attributes who start with a number in a file. I need to store it within a variable, cut src= out and write from there a new $string with \d concatenated to it: $string . $d. Is it possible to store only...

Updating Ubuntu 11.04 to 12.04 preferrably through command line

linux,command-line,installation,command-line-arguments,updates
I am attempting to update my Ubuntu Natty Narwhal (11.04) to Precise Pangolin (12.04). When I checked the Update Manager, I was told I couldn't do that. I had to get to 11.10 first, if I want it safely. Sounds like a plan. And so I've ran through the Update...

How can I pass the result of a command to another command in one line?

bash,shell,command-line,concatenation,command-line-interface
How can I pass minutes since midnight to a cli in one line? This works: echo $[ ( ( `date "+%s"` - 28800 ) % 86400 ) / 60 ] // Correctly returns minutes since midnight in PST But how can I pass the same into another command? This doesn't...

grep and sed - find function calls in files

bash,command-line,sed,grep
I need to find usages of class methods in project folder (for refactoring). Now I'm search with grep -nr "className." .. And get list like: file1.js:874: var x = className.method1() + m; file5.js:330: console.log(className.method2()); etc... My goal is to get only methods that used in files without any code around....

Via Windows command line, how can we compile a Netbeans C/C++ application?

c++,netbeans,command-line,ant,compilation
Let's take this simple C/C++ application Netbeans project folder. In Netbeans IDE, we just hit build button on the toolbar to build the application. I want to do that automatically via Windows command line, how can I do that? I did google, and found some related posts though not very...

Windows command line - filter lines with non-zero values

windows,command-line,cmd
I have a file.data whose content is as below: 140919071513,10,0,1,0,0 140919071513,11,0,1,0,0 140919071513,12,67,1,0,0 140919071513,13,89,1,0,0 140919071513,14,0,1,0,0 140919071513,15,32,1,0,0 140919071513,16,0,1,0,0 140919071513,17,0,1,0,0 140919071513,18,78,1,0,0 140919071513,19,0,1,0,0 140919071513,20,34,1,0,0 I need to run a one-line command in Windows-DOS to get the below output: (non-zero values in 3rd column) 140919071513,12,67,1,0,0 140919071513,13,89,1,0,0 140919071513,15,32,1,0,0 140919071513,18,78,1,0,0...

Taking multiple header (rows matching condition) and convert into a column

bash,perl,command-line,awk,sed
Hello I have a file that has multiple Headers in it that I need to have turned into column values. The file looks like this: Day1 1,Smith,London 2,Bruce,Seattle 5,Will,Dallas Day2 1,Mike,Frisco 4,James,LA I would like the file to end up looking like this: Day1,1,Smith,London Day1,2,Bruce,Seattle Day1,5,Will,Dallas Day2,1,Mike,Frisco Day2,4,James,LA The file...

Python command line arguments linux

python,linux,command-line,terminal,arguments
I have this little program(I know there is a lot of errors): #!/usr/bin/python import os.path import sys filearg = sys.argv[0] if (filearg == ""): filearg = input("") else: if (os.path.isfile(filearg)): print "File exist" else: print"No file" print filearg print "wasn't found" If i start it by typing python file.py testfile.txt...

Windows CMD Batch: FOR /R with DelayedExpansion

batch-file,for-loop,command-line,cmd,variable-expansion
On my desktop, there is a folder named "test". Inside this folder is two files, "file1.txt" and "file2.txt". Take a look at this simple batch script: @ECHO OFF SET test="C:\Users\Tyler\Desktop\test" ECHO %test% FOR /R %test% %%F IN (*) DO ( ECHO %%F ) As you might expect, it outputs the...

Grails 3.0.2 missing generate-views

java,grails,command-line,ide,ggts
I'm new to grails and I'm trying to get my first HelloWorld from it. I can generate it with the controller, but I can't create a view because it isn't listed in the Grails (3.0.2) list of command. Because any IDE support grails 3.*, I can't create it by that...

Increment Serial Number using EXIF

windows,powershell,command-line,exif,exiftool
I am using ExifTool to change the camera body serial number to be a unique serial number for each image in a group of images numbering several hundred. The camera body serial number is being used as a second place, in addition to where the serial number for the image...

Find folder named with lowest number in a directory , conditional statement on the command line

windows,batch-file,command-line,conditional-statements,xcopy
I'm new to conditional statements with the command lein, I'd like to write a batch file for a server running Windows Server 2003 to do a similar task as this, but for the statement to find the lowest numbered folder (including subdirectories) and copy that to an external drive attached...

how does apache commons-cli parses \\t character

shell,command-line,command-line-interface,backslash,apache-commons-cli
I need to pass tab as an argument in commons-cli. When I give the argument as "\\t", the command line parser parses it as "\t" character itself but not TAB ( ) white space. How can I achieve this? Edit : As suggested by @centic, updating the question with how...