I want to perform an action when swap is being used too heavily. My first thought was to use free, grep for "Swap:", and cut the column that shows how much is being used. But that just isn't happening.
The man page for cut says that TAB is the default delimiter, but:
Quote:
[jnojr@netcentric ~]$ free | grep Swap | cut -f4
Swap: 8388600 3198076 5190524
|
I tried adding the tab character specifically a couple of ways:
Quote:
[jnojr@netcentric ~]$ free | grep Swap | cut -d'' -f4
cut: the delimiter must be a single character
Try `cut --help' for more information.
|
(That was single-quote, TAB, single-quote)
Quote:
[jnojr@netcentric ~]$ free | grep Swap | cut -d$'\t' -f4
Swap: 8388600 3193524 5195076
|
I suppose it's possible that free isn't using a tab character to format the output, but that doesn't make a lot of sense to me.