2
votes
3answers
906 views

How do I delete a random line in a text file from a given range?

I have a text file and I want to delete random lines from a range. Here is an example: Line 1: abcd Line 2: efgh Line 3: ijkl Line 4: mnop Line 5: qrst Line 6: uvwxyz Out of these six, I want ...
14
votes
3answers
21k views

Why does “ps aux | grep x” give better results than “pgrep x”?

I've just tried the following command on my Ubuntu, it doesn't show a thing: pgrep php5 shouldn't it return the process id of php5(which the following command just does)?: ps aux | grep php5 So, ...
3
votes
2answers
2k views

align columns right

For the command shell, is there a common program like column that has an option to align specific or all columns to the right, if not also detect numeric fields and do so automatically for those? ...