Some partial commands produce their output in a specific order.
For example both good process and good service produce sound good.
That is sorted alphabetically by name.
Get a grant like produces output sorted by time.
Sometimes you might want command output sorted differently.
The sort object Command which has the LS sort can do that for you.
The command accepts one or more properties names to sort on.
By default the command starts in ascending order.
If you want to reverse this sort order at the does descendant parameter.
If you specify more than one property the command sorts on the first property first and then on the
second property and so on.
It is not possible in a single command to sort on the one property in ascending order and neither in
descending order.
For example Gazzara service pipes sort object property name descendant.
Or another example is Gazzara was sort of name the details.
See also an abbreviation for the Sanden.
You can shorten the parameters.
Or another example is good service sort answered by stators and then name by default string properties
of sorted without regard to case.
In other words lower case and upper case letters are treated the same parameter.
So for sort objects enable you to specify a case sensitive sort of specific cultures certain rules and
other options.
Now let's have some practice.
Use an got member command will sort object unproper to sort of multiple properties and specifies certain
options so to display a list of processes sorted by Breau society we could run get grossers pipe sort
object does property ID so read thought in it by id property to display a list of services sorted by
stators we could run the following command to service what sort object property state has to display
a list of the most recent 10 security around Low Countries sorted with the oldest entry first.
We can run the following command.
Got the wrong clock.
The log name security in us can pipe it to sort object and sorted by property time written.
No that stopped appears before Ron and because the property is stored as a number internally with zero
stopped coming before one run.
Another example is to display a list of services sorted first by stators then by name.
We could run Gazzara Spybot to insert object and sorted by property name and status separated as karma.
What about measuring objects the mother or adject command can accept any kind of object in a collection.
By default the command counts the number of four objects in the collection and produces a measurement
object that includes the called the command.
The s measure latish property parameter of my other object enables you to specify a single property
that must contain numeric values.
You can then include the dash.
PS. does ever issue this minimum and maximum parameters to calculate those aggregate.
Well yes for the specified property please know that because Windows for Shell enables you to truncate
parameter names you can frequently see those returns says PS..
This mean this Max corespondent to common English abbreviations for those Rourke's.
However Desch average can not be shorted to does a Viji although beginning users frequently try the
parameter could be shortened to dash avi.
Because that is a legal truncation for them.
So please remember not that ADG but there's a V E is the truncation for average.
Now let's have some practice.
Measure object command let's count objects and calculate aggregate.
Well yes.
So to display the number of services on your computer we could run get service pyper to measure objects
to display the number of running processes we could run get processed and pipe it to measure object
and to display the total number.
Total amount and average amount of virtual memory being used by processors.
We could run the following command.
Got closer Spybot to measure object.
Thus property VM Desam does average or does every small one.
Sometimes you may not need to display all the objects produced by a command.
For example you have already seen how they get their Schrank lock command can produce a list of owners
in the US and lock Antrix.
Not all commands have the built in ability to limit their output like that.
However the select does object command can do this for Rannoch amounts output and of course Command
has a Neleus it is select select object can perform two separate tasks in one command select in a subset
of objects is just one of them.
If you think of a collection of objects as a table or spreadsheet select a subset means selecting just
certain roles with select objects you cannot specify a criteria to decide which role will be selected.
Instead you can select only a specific number of rows from the beginning or end of the collection.
You can also specify that a certain number of rows be skipped before the selection begins.
Let's review several examples.
To select the fields and processes based on lowest virtual memory use we could run the following command
get processed by sort object property by select object first.
Another example is to select the last and run and service is sorted by name.
To do that we could run get service 5 to sort object property name and pipe it to select object last
time.
Another example is to select five processes using the least amount of spew but skipping the one process
using the least Sibiu to do that we could run get pro-ISIS by to sort of object property Sibiu descended
by bit to select object first five and skip 1.
Now if you want to select properties of objects in addition to selecting the first or last number of
rows from a collection you can use select object to select specified properties.
If you think of a collection of object as a table or a spreadsheet you can.
You can choose the specified properties to display.
So you are choosing the columns to display after you choose the properties you want select object will
remove all other properties.
For example if you want to sort in a particular property but not display it you must use sort object
first and then select object to specify the properties that you want to display.
Use caution when specifying property names sometimes the default screen display created by Windows for
itself does not use real property name in table column collimate headers.
For example the output of get groceries includes a corn labeled soupy use.
However the system got diagnostics that process object type does not have a property that has the name
the actual property name is CPQ.
You can see this by piping the output of get plosives to get mamber as a best practice.
Always review proper names in the output of get mamber before you use those property names in another
command.
Doing This guarantees that you are using the actual property name and not a made up name created to
for display purposes.
Now let's review several examples.
If you wanted to specify the properties to display record you use property parameter of select object.
For example get processed by a to select object property name ID the AM PM MCP you.
Another example if you want to combine that parameter with Foster last you could use the following command
get processed by apatosaurus object sorted by property V.M. in descending order and then Pypard to select
object by property name.
VM does first term so it'll show us frustum objects.
Please know that the output of that command might look odd but by default Windows partial tries to feel
that it's your console window.
By spreading out table Colon's when you display only some Colon's the resulting output contains a large
amount of space in between the columns.
You can also specify a wildcard barter for a property name.
Also if that results in lots of properties being selected some of those properties might be truncated
because of screen space for example got processed by a 2 select object.
Thus property asterisk.
Now let's practice a bit with the various ways to use Select object will select subsets of collection
and select specific properties.
The first example is to display the Ten largest processes by virtual memory use to do that.
We can run the following command.
Get closest piped to sort object by property VM and in descending order then pipe it to select object
and so forth.
Another example is to display the current day of week for example Monday or Tuesday to do that.
We could run get date by to select object does propertied day of week and so the example is to display
the Ten Most recent security event log.
And this will include showing where they went I did time return and wound message to do that we could
type event log Desch New-Year's turned us Lagny security and pipe it to select object does property
well-tended time written on message.