command-line

Build Eclipse Java Project from Command Line

Is there a way to compile an Eclipse-based Java project from the command line? I'm trying to automate my build (using FinalBuilder not ant), and I'm neither a Java nor Eclipse expert. I can probably figure out how to do this with straight java command line options, but then the Eclipse project feels like a lot of wasted effort. In th...

Redirecting ConsoleOutput containing pseudo-loc (unicode) strings in C#

I'm running a console app (myApp.exe) which outputs a pseudo localized (unicode) string to the standard output. If I run this in a regular command prompt(cmd.exe), the unicode data gets lost. If I run this in a unicode command prompt(cmd.exe /u) or set the properties of the console to "Lucida Console" then the unicode string is maintaine...

What Linux/Unix commands are outdated and have powerful alternatives?

Today I discovered you can make less act like tail -f. less filename, then press Shift-F to start follow mode. Just like tail, but you have all the added features of less - like scrolling, searching, and the highlighting of search hits. I've been watching log files with tail for years. This just made me ponder: are there other comm...

What is the best way of parsing many complex command-line arguments in Java?

I have used getopt in Python and was hoping there would be something similar in Java. Please give a reason why your answer is better than the others. ...

Getting The Full Result from "ps"

Hi, How do I get the full width result for the *nix command "ps"? I know we can specify something like "--cols 1000" but is there anyway I can the columns and just print out everything? ...

Howto do python command-line autocompletion but NOT only at the beginning of a string

Python, through it's readline bindings allows for great command-line autocompletion (as described in here). But, the completion only seems to work at the beginning of strings. If you want to match the middle or end of a string readline doesn't work. I would like to autocomplete strings, in a command-line python program by matching wha...

Best way to run remote commands on a Windows server from Java?

Are there any existing solutions for remote execution of commands on a windows server from Java natively? psexec.exe is not an option since the java application has to be cross platform. Even a preexisting solution using Java RM would be sufficient. Currently, I'm using an SSH client library to ssh through java into a Windows server th...

How to create empty text file from a batch file?

Can somebody remember what was the command to create an empty file in MSDOS using BAT file? ...

Would Python make a good substitute for the Windows command-line/batch scripts?

I've got some experience with Bash, which I don't mind, but now that I'm doing a lot of Windows development I'm needing to do basic stuff/write basic scripts using the Windows command-line language. For some reason said language really irritates me, so I was considering learning Python and using that instead. Is Python suitable for suc...

What's the quickest way to get the mean of a set of numbers from the command line?

Using any tools which you would expect to find on a nix system (in fact, if you want, msdos is also fine too), what is the easiest/fastest way to calculate the mean of a set of numbers, assuming you have them one per line in a stream or file? ...

How to do a HTTP HEAD request from the windows command line?

What's the best way (or tool) on the Windows (Vista) command line to get size and modification time for a file on a remote webserver, without downloading it? ...

Linux command (like cat) to read a specified quantity of characters

Is there a command like cat in linux which can return a specified quantity of characters from a file? e.g., I have a text file like: Hello world this is the second line this is the third line And I want something that would return the first 5 characters, which would be "hello". thanks ...

Setting multiple jars in java classpath

Is there a way to include all the jar files within a directory in the classpath? I'm trying java -classpath lib/*.jar:. my.package.Program and it is not able to find class files that are certainly in those jars. Do I need to add each jar file to the classpath separately? ...

How to automate the generation of HTML output in Enterprise Architect

Enterprise Architect has a way to generate the documentation in HTML/RTF/etc. that you could publish, but you have to use its GUI to do that manually. When you have your *.eap files in a CVS/Subversion server, it would be useful to have a script that would check out daily the latest version and publish it in a web server. As long as I kn...

grep --exclude/--include syntax (do not grep through certain files)

I'm looking for the string "foo=" (without quotes) in text files in a directory tree. It's on a common Linux machine, I have bash shell: grep -ircl "foo=" * In the directories are also many binary files which match "foo=". As these results are not relevant and slow down the search, I want grep to skip searching these files (mostly JPE...

How to get RPATH with $ORIGIN to work on Code::Blocks GCC?

I'm trying to link an RPATH containing the special string $ORIGIN into an executable built using GCC with the Code::Blocks IDE. I've specified -Wl,-R$ORIGIN in the linker options for the project, but the command line output to GCC is wrong (stripped for clarity): g++ -Wl,-R What is the correct way to specify this argument for Code:...

What's the best tool or method to search for a specific word in a codebase?

What tool or method do you recommend to find and replace values in your code? If code is on Linux/Unix, are find and grep the best method? I'm currently using Dreamweaver's find and replace and it's sloooow. ...

Read environment variables from file in Windows Batch (cmd.exe)

I'm trying to read variables from a batch file for later use in the batch script, which is a Java launcher. I'd ideally like to have the same format for the settings file on all platforms (Unix, Windows), and also be a valid Java Properties file. That is, it should look like this: setting1=Value1 setting2=Value2 ... Is it possible to ...

How can I run Cygwin Bash Shell from within Emacs?

I am running GNU Emacs on Windows so entering: M-x shell launches the Windows command-line DOS shell. However, I would like to instead be able to run the Cygwin Bash Shell (or any other non-Windows shell) from within Emacs. How can this be easily done? ...

What are good Linux/Unix books for an advancing user?

Are there any good books for a relatively new but not totally new *nix user to get a bit more in depth knowledge (so no "Linux for dummies")? For the most part, I'm not looking for something to read through from start to finish. Rather, I'd rather have something that I can pick up and read in chunks when I need to know how to do somet...