#ONTAP CLI negating selectors

1 messages · Page 1 of 1 (latest)

flat raven
#

Maybe this is more widely known and somehow I missed it for 15 years... but I've never seen it in an example or demonstrated to me.

Today I randomly happened to try "!" on a selector to negate it:
> vol move -vserver svmname -phase !completed

and it shows you moves in progress that are not completed.

So, what is this construct called? I ask because now I want to be able to look up what other things support it and if there are any other operators besides "!".

stark dirge
#

!completed = Not Completed

#

vol show -volume !vol0,!*root*
sho volumes that are NOT vol0 and NOT *root*

outer flare
weak bronze
#

I show customers this all the time and it blows their minds 🙂

stark dirge
#

Agreed. Especially the long timers that think they know everything

full aurora
#

the {... } queries are especially powerful (moving many LIFs or Volumes around etc.)

stark dirge
#

Too bad it doesn’t work with other things.
Like “cron create -hour 0…23”

You need to specify every hour, comma separated

flat raven
flat raven
#

And somehow I picked up on >,<,>= operators along the way. Just couldn't muster the google-fu to find this documentation.

manic jungle
#

aliases would be gold... and a history buffer that doesn't die after one logs out

delicate sigil
#

rows 0 default would save me several minutes a year. 🤣

spice magnet
#

Another handy one for checking the event log entries in the last x amount of time.

Example: Show all event log entries from the last 10 minutes.

event show -time >10m

Also, not as widely know is the -sort-by, but you have to be in diag mode.

Example: Show all volumes sorted by vserver and then by size (GB).

set d -c off -un gb;vol show * -sort-by vserver,size;set adm -c on -un auto
flat raven
#

Weird that -sort-by is in diag mode, because no I never saw that before!

stark dirge
#

And it’s 100% hidden in that it does not even tab out!

I think I speak for EVERYONE in that it should be in the standard “admin” command listing

harsh drift
full aurora
#

diag mode is not (only) about "harmful" commands. Just look at the options to nfs modify in admin vs. diag mode. Almost nothing in there is harmful