Terminal is a great application. And we usually use Terminal for editing scripts and invoking things. But what about invoking Terminal from, well, Terminal. For starters, let’s look at opening a Terminal session to the root of the boot volume (aka /): open -a Terminal / The -a option, when used with the open command, allows you to define which application that the item defined in the following position will open in. For example, you could open an XML file in Xcode open -a Xcode /usr/share/postgresql/pg_hba.conf.sample You could then open Terminal by passing other commands into the command. For example, to open a new Terminal window to the current working…
-
-
Programatically Clipboarding in Windows
My last article showed how to interface with the clipboard in Mac OS X. Windows 7 comes with the same feature, but instead of pbcopy it’s simply clip. Since you don’t ls, we’ll pipe the output of dir into the clipboard: dir | clip Enjoy & no more complaining that I like one platform more than the other – you know who you are!
-
Piping Commands
The pipe (|) character is used to combine multiple commands. A pipe is a temporary storage place where the output of one command is stored and then passed as the input for a second command. Pipes are used to run more than two commands from the same command line. The sort command is used to sort data. When you run the ls –l command, you will see a listing of the files in a directory with each file shown on a separate line. When you use a pipe after the command and then sort your results, you will sort the data listed on the screen by the list command. The…