command-line

What's the best way to start and stop SQL Server from the command line?

I need to start and stop SQL Server from the command line. I am willing to write a small C# program if necessary, but I suspect that there's something (PowerShell, maybe?) that currently exists that does this gracefully. Thank you ...

How to create a file without a Command Prompt window

I'm using WinRAR SFX module to create an installation, and use its presetup option to run some preliminary tests. Since wscript can only accept vbs file, and not the script itself, I first run "cmd /c echo {...script code...} > setup.vbs", and then I run "wscript setup.vbs". The run of the first cmd command opens a brief command window,...

What is the safest way to empty a directory in *nix?

I'm scared that one day, I'm going to put a space or miss out something in the command I currently use: rm -rf ./* Is there a safer way of emptying the current directory's contents? ...

Unix command to find lines common in two files

I'm sure I once found a unix command which could print the common lines from two or more files, does anyone know its name? It was much simpler than diff. ...

Advantages of PHP CLI?

What are the benefits of PHP's CLI over other scripting languages/environments such as VBScript or even windows scripting? ...

Which is the faster way to interact with SourceSafe? Command line or object model?

Our project is held in a SourceSafe database. We have an automated build, which runs every evening on a dedicated build machine. As part of our build process, we get the source and associated data for the installation from SourceSafe. This can take quite some time and makes up the bulk of the build process (which is otherwise dominated b...

Windows Explorer "Command Prompt Here"

I frequently find myself with a folder open in Windows, wishing to have a command prompt open with the same working directory. I am aware of Power Toys "Command Prompt", but that only works as a context menu item on the folder, and not from inside the folder if you are already there. I know you can navigate to the parent directory, and...

How to invoke groovy with 'java' from command line

I have to ship some groovy code to some users that have only java installed (no grooy, no $groovy_home, etc). I'm trying to invoke groovy from the commandline but I'm having no luck. Here's my bat file: java -classpath .;lib;bin;bin-groovy introspector.AclCollector And here's my exception: Exception in thread "main" java.lang.NoClass...

Emacs equivalent of Vim's command history (for typed in Meta-x commands)

Question: For typed in commands invoked via M-x I am having difficulty understanding how Emacs allows recalling and rerunning the commands. The command-history works quite differently from Vim. It puts the commands in a buffer rather than the "minibuffer". Is there a way to get something similar to Vim's approach (i.e., previously typed...

Fix gnu screen blocking reverse video

I alias screen to 'TERM=screen screen' in order to fix it from messing up some key bindings (e.g. switching delete and backspace) However, when I do this screen doesn't show some reverse video output -- for example, it works in vim, but not output from watch -d . If I run \screen thus avoiding the alias reverse video always works as exp...

Unicode characters in Windows command line - how?

We have a project in TFS that has a non-English character (š) in it. When trying to script a few build-related things we've stumbled upon a problem - we can't pass the š letter to the command line tools. Command prompt or what not else messes it up, and the tf.exe utility can't find the specified project. I've tried different formats fo...

Monitor a set of files for changes and execute a command on them when they do.

The (command line) interface I have in mind is like so: watching FILE+ do COMMAND [ARGS] (and COMMAND [ARGS])* Where any occurrence of "{}" in COMMAND is replaced with the name of the file that changed. And note that "do" and "and" are keywords. For example: > watching foo.txt bar.txt do scp {} somewhere.com:. and echo moved {} to ...

Best commandline time tracking application?

I'm looking for something that runs in a terminal and allows me to track time. I'd like it to be open source but that isn't necessary. Most time tracking apps I've found are either web or gui based and there for take longer to enter data then I'd like. ...

How to test SQL for validity from the command line?

Is there a good tool for ensuring that an SQL query is valid ANSI SQL, and optionally what DBMSs will fail to interpret it? I've found http://developer.mimer.com/validator but I was wondering whether there is a command line tool, preferably open source. ...

OS X: creating or extracting preview(.jpg,.png) of .eps file

I'm using a mac and looking to batch convert a large amount of eps files and create jpg previews of each. I'm looking for preferably a command-line utility, or some type of workflow to easily batch a large number of files. Thanks for any ideas or input ...

Passing arguments with DOS wildcards to a Python script

I want to do something like this: c:\data\> python myscript.py *.csv and pass all of the .csv files in the directory to my python script (such that sys.argv contains file1.csv, file2.csv, etc.) But sys.argv just receives *.csv indicating that the wildcard was not expanded, so this doesn't work. I feel like there is a simple way to ...

gcc -Wall and -Wunknown-pragmas

-Wall enables a warning I do not want. Specifically -Wunknown-pragmas, how do I have GCC suppress the message after it is enabled by Wall ? ...

Restore drive image with PC reboot

I need a way to restore a drive image (C:) automatically.. My client earlier had some Norton Ghost 2003 floppy disk with some batch program to initiate a Drive Restore operation via the command-line of GHOST.EXE (the main executable of Norton Ghost 2003) Any available programs that can restore a drive image via the command line, or simi...

What are the most often linux (power) commands that you use?

To find files containing a particular string, I use this often find . -name * | xargs grep -iH "string" ...

How to repace ${} variables in a *nix text file

I want to pipe the output of a "template" file into mysql, the file having variables like ${dbName} interspersed. What is the commandline utility to replace these instances and dump the output to stdout? ...