one-liners

Category archives for one-liners

Type: ls | wc -l The output is an approximation of how many files are in the current directory.

This is a continuation of a discussion of the role of the command line in both the functionality and the culture of the three main operating systems used today general purpose desktop computers: Linux, and the other two. Today’s toic: Underlying power.

This is the second part of a series of posts on the Power of the Command Line. (The first post was: The Command Line in Linux, Mac OSX and Windows) The lesson of today’s post is: Don’t be a chump, learn to love the command line!

This is the first in a series of posts on just what the title says: The command line. The main point will be this: Stop worrying about the command line.

Today’s Linux One-Liner

Try this: ps -eo user,pcpu,pid,cmd | sort -r -k2 | head -6 What the heck does that do?

Is he doing this from memory or is he looking it up as he goes along?

Redirecting Output

Sean Powers’ tip of the day: Thank you Sean. now, can we do a better job that Sean did and come up with some actual uses for this ability?

What is your disk usage?

In Linux, if you want to find out what your disk usage is by directory, in order to see what the heck is filling up your hard drive, try this at the command prompt:

ping traceroute

Very funny, sean. I’m talking about the simu-bot.

If you try to sudo your way through a command with pipes and/or redirects, part of the sequence of commands may be producing sudo-read/writeable streams of data or data objects, which the other parts of the sequence can’t use because they were spawned by your shell and not root. The solution is to embed the…