command-line

How can I reverse the lines in a file?

I'd like to reverse the lines in a text file (or stdin), preserving the contents of each line. So, ie, starting with: foo bar baz I'd like to end up with baz bar foo Is there a standard unix commandline utility for this? ...

How to access command line parameters outside of Main in C#

I am writing a .NET class that needs to parse the command line of the process. I don't want to have a dependency between the Main() method and that class. How can the class access the command line? ...

C# command line option parsing libraries/strategies similar to getopt?

Forgive me if this has already been covered but parsing command line options seems to be my second job lately. Information about getopt can be found here. DUPLICATE : http://stackoverflow.com/questions/631410/looking-for-a-command-line-argument-parser-for-net ...

SharePoint deployment failure using VS2008 on the comannd line

I am trying to implement a nightly build environment for our SharePoint solution that includes VS 2008 and VS 2008 extensions for Windows SharePoint Services 3.0 (version 1.2). When I deploy via the VS 2008 GUI it works fine. When I use the command line: c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe SharePoint.sln...

how to show lines in common (reverse diff)?

I have a series of text files for which I'd like to know the lines in common rather than the lines which are different between them. Command line unix or windows is fine. foo: linux-vdso.so.1 => (0x00007fffccffe000) libvlc.so.2 => /usr/lib/libvlc.so.2 (0x00007f0dc4b0b000) libvlccore.so.0 => /usr/lib/libvlccore.so.0 (0x00007f0dc483f000...

unix tool to remove duplicate lines from a file

I have a tool that generates tests and predicts the output. The idea is that if I have a failure I can compare the prediction to the actual output and see where they diverged. The problem is the actual output contains some lines twice, which confuses diff. I want to remove the duplicates, so that I can compare them easily. Basically,...

How to request JVM garbage collection (not from code) when run from Windows command-line

Hi. how could I request Java garbage collection externally, starting the program from JAR (Windows BAT used)? From the Java code I can do it with System.gc() When running a JNLP distribution, I get this "Java console" turned on from Control Panel / Java / ... and this Java console provides manual garbage collection. But... When I'm...

Set plugin's property on the command line in maven 2

In maven 2.x, how would one set a plugin's property on the command line instead of in the <configuration> of that plugin in the pom or in settings.xml? For example, if I was using mvn dependency:copy-dependencies(seen here) how can I set the useRepositoryLayout property without touching either the pom or my settings.xml? Thanks! ...

Batch script to issue commands to mySQL db?

I am trying to create a batch script that would connect to a mySQL database and issue a delete command: @echo off echo Resetting all assessments... mysql -hlocalhost -urdfdev -p%1 rdf_feedback delete from competency_question_answer; I will run this script providing the password as a command-line argument, but all this script does is, ...

Bluetooth from the Command Line

How do I access files on another device/machine over Bluetooth from the command line? ...

Is there a command line option like devenv.exe /Edit for Sql Server Management Studio

I'm using visual studio's external tools to open .sql scripts in Sql Server Management Studio (SSMS). The problem is, each time I use the external tools command to open a .sql file from visual studio, it opens a new instance of SSMS. Visual Studio has a switch /Edit that will do this, is there one for SQL Server Management Studio? ...

CLI Patterns/Antipatterns for usability

What patterns contribute or detract from the usability of a CLI interface? As an example consider the CLI for ClearCase. The CLI is very comprehensive (+1) but it is has several glaring opportunities. Recently, I wanted to force the files to lower case into ClearCase using clearfsimport. Unfortunately I wound up on the documentation ...

Linux Command: Directory inside a directory

So I have have a directory - lets say /dir/. In it I have these folders- /dir/fold1/ /dir/fold2/ /dir/fold3/ each of these folders (fold1,2,3) may contain a folder called foo. I want to list all the folders inside dir, that have inside them a folder called foo. Thanks! ...

How can I escape characters in SQLite via bash shell?

I am trying to send a query to SQLite from the command line using bash. I need to escape both single quotes and double quotes, and escape them so that bash does not misinterpret them. Here is a typical query: select * from contacts where source = "Nancy's notes"; How can I send this query from the command line? The basic syntax is som...

How to delete files in Visual Studio Pre-build event command line

I am trying to delete files in my $(TargetDir) within visual studio before building a project. How do you have to format command line to get around this problem I am getting below? ...

How to find unique lines in a text file from command line?

I would like to know how to extract a list of unique lines from a text file. Preferably through Cygwin. ...

What commands must I learn to become an effective Linux shell script programmer?

I have recently started moving into the world of Linux development. I wanted to learn some new things and thought bash might be fun. As I learn more about bash programming I have found that there are quite an assortment of useful tools to be used (such as grep, tr, awk, etc.) There are so many that I just do not know which ones are "vita...

sql profiler 2008 does not accept template name in command line launch

I am trying to launch sql profiler 2008 from the command line launch. the syntax I used : C:\Program Files\Microsoft SQL Server\100\Tools\Binn>profiler90 /S server /D dbname /U sa /P password /T "C:\Documents and Settings\template.tdf" actual result: profiler opens, successful login happens but still I am forced to select a template. ...

How can I open a message box in a Windows batch file?

I'm kind of going through DOS again and it's been ages, so I need a lot of help. My question is; how can I make a batch file open a popup screen? Like: Sorry for the poor English, I'm Dutch/Italian >.< ...

Peak memory usage of a linux/unix process

Is there a tool that will run a command-line and report how much RAM was used total? I'm imagining something analogous to /usr/bin/time ...