Learning the Shell

Why Bother?

Why do you need to learn the command line anyway? Well, let me tell you a story. A few years ago we had a problem where I used to work. There was a shared drive on one of our file servers that kept getting full. I won’t mention that this legacy operating system did not support user quotas; that’s another story. But the server kept getting full and it stopped people from working. One of our software engineers spent the better part of a day writing a C++ program that would look through all the user’s directories and add up the space they were using and make a listing of the results. Since I was forced to use the legacy OS while I was on the job, I installed a Linux-like command line environment for it. When I heard about the problem, I realized I could do all the work this engineer had done with this single line:

du -s * | sort -nr > $HOME/user_space_report.txt

Graphical user interfaces (GUIs) are helpful for many tasks, but they are not good for all tasks. I have long felt that most computers today are not powered by electricity. They instead seem to be powered by the “pumping” motion of the mouse! Computers were supposed to free us from manual labor, but how many times have you performed some task you felt sure the computer should be able to do but you ended up doing the work yourself by tediously working the mouse? Pointing and clicking, pointing and clicking.

I once heard an author say that when you are a child you use a computer by looking at the pictures. When you grow up, you learn to read and write. Welcome to Computer Literacy 101. Now let’s get to work.

Contents


   转载规则


《Learning the Shell》 吴杭沉 采用 知识共享署名 4.0 国际许可协议 进行许可。
 上一篇
Navigation Navigation
NavigationIn this lesson, I will introduce your first three commands: pwd (print working directory), cd (change director
2020-09-27
下一篇 
GDB 调试指南 GDB 调试指南
本文用一个「双线程、双互斥锁、加锁顺序相反」的最小示例,演示如何用 gdb attach 定位程序死锁。死锁是并发编程里最棘手的问题之一,通过这个例子可以掌握一套通用的分析思路:先看线程与栈回溯(backtrace),再顺着栈找到等待的锁,
2020-09-13
  目录