The Unix Tools Are Your Friends
The Unix Tools Are Your Friends
Diomidis Spinellis
IF, ON MY WAY TO EXILE ON A DESERT ISLAND, I had to choose between an IDE and the Unix toolchest, I’d pick the Unix tools without a second thought. Here are the reasons why you should become proficient with Unix tools.
First, IDEs target specific languages, while Unix tools can work with anything that appears in textual form. In today’s development environment, where new languages and notations spring up every year, learning to work in the Unix way is an investment that will pay off time and again.
Furthermore, while IDEs offer just the commands their developers conceived, with Unix tools you can perform any task you can imagine. Think of them as (classic pre-Bionicle) Lego blocks: you create your own commands simply by combining the small but versatile Unix tools. For instance, the following sequence is a text-based implementation of Cunningham’s signature analysis—a sequence of each file’s semicolons, braces, and quotes, which can reveal a lot about the file’s contents:
for i in *.java; do
echo -n "$i: "
sed 's/[^"{};]//g' $i | tr -d '\n'
echo done
In addition, each IDE operation you learn is specific to that given task—for instance, adding a new step in a project’s debug build configuration. By con- trast, sharpening your Unix tool skills makes you more effective at any task. As an example, I’ve employed the sed tool used in the preceding command sequence to morph a project’s build for cross-compiling on multiple processor architectures.
176 97 Things Every Programmer Should Know

Unix tools were developed in an age when a multiuser computer had 128KB of RAM. The ingenuity that went into their design means that nowadays they can handle huge data sets extremely efficiently. Most tools work like filters, processing just a single line at the time, meaning that there is no upper limit in the amount of data they can handle. You want to search for the number of edits stored in the half-terabyte English Wikipedia dump? A simple invocation of
grep ‘’ | wc –l
will give you the answer without sweat. If you find a command sequence gen- erally useful, you can easily package it into a shell script, using some uniquely powerful programming constructs, such as piping data into loops and condi- tionals. Even more impressively, Unix commands executing as pipelines, like the preceding one, will naturally distribute their load among the many pro- cessing units of modern multicore CPUs.
The small-is-beautiful provenance and open source implementations of the Unix tools make them ubiquitously available, even on resource-constrained platforms, like my set-top media player or DSL router. Such devices are unlikely to offer a powerful graphical user interface, but they often include the BusyBox application, which provides the most commonly used tools. And if you are developing on Windows, the Cygwin environment offers you all imag- inable Unix tools, both as executables and in source code form.
Finally, if none of the available tools matches your needs, it’s very easy to extend the world of the Unix tools. Just write a program (in any language you fancy) that plays by a few simple rules: your program should perform just a single task; it should read data as text lines from its standard input; and it should dis- play its results unadorned by headers and other noise on its standard output. Parameters affecting the tool’s operation are given in the command line. Fol- low these rules, and “yours is the Earth and everything that’s in it.”
The Unix Tools Are Your Friends的更多相关文章
- Cross-platform Tools
MinGW和Cygwin都解决了C++跨平台交叉编译的问题,使Linux下的程序在Windows上编译运行成为可能. MinGW给习惯在Linux上开发的人员在windows上提供了一套类似的工具集: ...
- 让 ASP.NET vNext 在 Mac OS 中飞呀飞。。。
写在前面 阅读目录: 娓娓道来 Install ASP.NET vNext Command Line Tools 安装 Homebrew 使用 Homebrew,安装 KVM Install Subl ...
- 生成lua的静态库.动态库.lua.exe和luac.exe
前些日子准备学习下关于lua coroutine更为强大的功能,然而发现根据lua 5.1.4版本来运行一段代码的话也会导致 "lua: attempt to yield across me ...
- VS2012使用Git并连接到osc@git
1.下载GitExtensions并安装 在http://sourceforge.net/projects/gitextensions/files/latest/download 下载 安装时请注意 ...
- 【Docker 在 windows 10 / windows 8 下安装】
步骤: 1. 下载: a.https://github.com/boot2docker/windows-installer/releases 下载一个 windows 客户端: 安装时建议勾选:Boo ...
- Nginx初学者指南
Starting, Stopping, and Reloading Configuration To start nginx, run the executable file. Once nginx ...
- Django开发博客- 部署
安装Git Git是一个被大量程序员使用的”版本控制系统”.此软件可以跟踪任何时间文件的改变,这样你以后可以随时召回某个特定版本. windows系统下面可以下载git-scm安装.除了第5步”Adj ...
- 命令行工具cmder
1.下载地址 http://bliker.github.io/cmder/ 分为两个版本:mini版和Full版 2.快捷命令配置: 比如,快速启动canssandra/redis数据库服务和查询工具 ...
- Beginner’s Guide(开始者向导)
This guide gives a basic introduction to nginx and describes some simple tasks that can be done with ...
随机推荐
- 深入解析当下大热的前后端分离组件django-rest_framework系列一
前言 Nodejs的逐渐成熟和日趋稳定,使得越来越多的公司开始尝试使用Nodejs来练一下手,尝一尝鲜.在传统的web应用开发中,大多数的程序员会将浏览器作为前后端的分界线.将浏览器中为用户进行页面展 ...
- eclipse 关键字高亮显示
关键字高亮显示(变量.函数名……) Toggle Mark Occurrences (Alt + Shift + O), 也可以在eclipse主界面的快捷工具栏:按下那个小黄蜡笔图标,来设置高亮显 ...
- deepin使用root身份运行
https://blog.csdn.net/guanripeng/article/details/79630619
- HDU 5969 最大的位或【贪心/按位或/思维】
链接 最大的位或 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Subm ...
- POJ2032 Building a Space Station(Kruskal)(并查集)
Building a Space Station Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 7469 Accepte ...
- HDOJ 5693 D Game
众所周知,度度熊喜欢的字符只有两个:B 和D. 今天,它发明了一个游戏:D游戏. 度度熊的英文并不是很高明,所以这里的D,没什么高深的含义,只是代指等差数列[(等差数列百科)](http://baik ...
- 《深入理解Spark-核心思想与源码分析》(三)第三章SparkContext的初始化
3.1 SparkContext概述 SparkConf负责配置参数,主要通过ConcurrentHaspMap来维护各种Spark的配置属性. class SparkConf(loadDefault ...
- Java高级架构师(一)第24节:加入ehcache,把工程加入到Git
ehcache的maven配置: <!-- ehcache的jar --> <dependency> <groupId>net.sf.ehcache</gro ...
- JavaScript:this是什么
JavaScript:this是什么? 定义:this是包含它的函数作为方法被调用时所属的对象. 说明:这句话有点咬嘴,但一个多余的字也没有,定义非常准确,我们可以分3部分来理解它! 1.包含它的函数 ...
- ubi层次
转:http://www.360doc.com/content/11/0518/13/496343_117643185.shtml UBI是什么? 它是一种flash管理方式 flash是一系列连续的 ...