Archive for August, 2008

Suppose you want to know how many files are in the current directory.

ls | wc -l

Suppose you want to know about the five processes that are consuming the most CPU time on your system:

ps -eo user,pcpu,pid,cmd | sort -r -k2 | head -6

The ps command’s o lets you specify the columns that you want to be shown. sort -r does a reverse order sort with the second column (pcpu) as reference (k2). head gets only the first six lines from the ordered list, which includes the header line. You can place pcpu as the first column and then omit the k2 option because sort by default takes the first column to do the sort.

Read the rest of this entry »

Like this blog? Why not buy me a cup of coffee?

Here’s a cool video tutorial on how you can hide your files inside an image file without other people knowing that there is still a file inside it.

Like this blog? Why not buy me a cup of coffee?