LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   linux command, meaning (https://www.linuxquestions.org/questions/linux-newbie-8/linux-command-meaning-521419/)

skylimit 01-21-2007 10:33 AM

linux command, meaning
 
Hi all, anyone know the meaning of this linux command and what is does pls?thanks in advance.

ps --- efl | grep vm

Wim Sturkenboom 01-21-2007 10:41 AM

It runs the PS command and sends what is found to the GREP command to search wor the word VM.

The symbol that transfers the output of one program to another is called the 'pipe'

Indiestory 01-21-2007 10:45 AM

the ps command firstly shows information about processes and there connected terminals, the e option displays the enviroment and the l option displays information cocerned with uid,pid etc. My man page didnt list the f option. grep just searches through the input ( from the pipe character) and show you stuff concerned with vm.

Mostly guess work, using the man page for ps, probably not right but im sure it makes sense in context for its use. Can i ask why you need to know, im guessing you've been told to type this from somewhere. Someone else could confirm that im right cause i doubt i am

skylimit 01-21-2007 11:04 AM

thanks but i dont really get it. e.g. ps - ef |grep processname
is used to show the names of processes running e.g 'zebra is running' etc.I heard of it during my linux labs at UNi and wish to know what it does. In other words what does ps ---efl |grep vm do?

PS. we are working on virtual machines in a linux host...
thanks once again

sumguy231 01-21-2007 12:01 PM

'ps -ef' is show every process on the system using full format according to the manpage. Its output is then piped to grep which returns only the lines containing the string 'vm'.

skylimit 01-21-2007 12:22 PM

thanks but in this case i mean ps ---efl | grep vm

is it same?

Indiestory 01-21-2007 12:33 PM

oh that, it gives me ilegal operation and that follows by useage information. That help you? ask your tutor

sumguy231 01-21-2007 12:46 PM

I don't think that would be valid usage in any situation. Are you sure that's exactly how you saw it?

Wim Sturkenboom 01-21-2007 11:13 PM

-e > all processes
-f > full format
-l > long format

Play with them and see what they do. The first line after you issued the ps-command tells you what each column is used for.

grep is a search utility to find the given string in it's input. It does not matter where it is. Input can be a file, the keyboard or the output of another command (as in your example).

Your example does not look for a process called 'vm' but for any column containing 'vm'. On my slackware, ps -ef displays the UID as a name (i.e. root, wim). So if a process is owned by a user called 'vm' and I pipe it through grep vm, it will find all processes owned by the user 'vm'. If there's also a process called 'vm', owned by amother user, it will also find that.

@Indiestory:
funny as you run Slackware (according to your profile); I run Slackware 10.1 and all three options are valid.

skylimit 01-22-2007 02:25 AM

many thanks guys.


All times are GMT -5. The time now is 07:31 AM.