Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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
'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'.
-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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.