LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-09-2005, 12:16 PM   #1
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Rep: Reputation: 47
Fuser command


[root@c83-250-88-242 ka]# fuser -a /home

/home:




What is the fuser comand? I looked at the man pages. It should see the user id, display unused files, kill processes accessing that file and search IPV4 sockets etc.

Could you tell me how to use it find some of the above?

Last edited by Gins; 08-09-2005 at 12:18 PM.
 
Old 08-09-2005, 01:08 PM   #2
Tuttle
Senior Member
 
Registered: Jul 2003
Location: Wellington, NZ
Distribution: mainly slackware
Posts: 1,291

Rep: Reputation: 52
It's more to do with the apps you are using. "lsof" will give a list of all files used by all applications, in the form:
[filename] [pid] [other.......stuff........]
From this you can infer pid's from files in use, fuser does a similar thing but you can find a process by socket too.... read the man page of both. twice.
 
Old 08-09-2005, 01:24 PM   #3
Gins
Senior Member
 
Registered: Jul 2004
Location: Germany
Distribution: open SUSE 11.0, Fedora 7 and Mandriva 2007
Posts: 1,662

Original Poster
Rep: Reputation: 47
Tutti

The 'ls of' command gave me a big list of files. I will write some of them here.


profile.d/ protocols rc0.d@ pango/ paper.config secure-mcservusers
rpm/ securetty rc1.d@ menu/ lynx-site.cfg enscript.cfg
sysconfig/ services rc2.d@ fam.conf oaf/ lftp.conf
raidtab shells rc3.d@ gtk-2.0/ sane.d/ ltrace.conf
fstab passwd- rc4.d@ menu-methods/ postfix/ mailcap.base
hosts group- rc5.d@ bootsplash/ ssh/ mailcap.vga
skel/ iproute2/ rc6.d@ bonobo-activation/ gimp/ mime.types
rpc rmt@ sysctl.conf gconf/ aliases@ mailcap
pwdb.conf shadow termcap gnome-vfs-2.0/ gnome/ issue
nsswitch.conf security/ modprobe.preload gnome-vfs-mime-magic gnucash/ updatedb.conf
 
Old 08-09-2005, 02:15 PM   #4
Tuttle
Senior Member
 
Registered: Jul 2003
Location: Wellington, NZ
Distribution: mainly slackware
Posts: 1,291

Rep: Reputation: 52
What program are you looking for exactly? A handy addon is "grep" eg.
Code:
lsof | grep gnome
I think you need to be more specific with the fuser command; if I use my home folder i get this:
Code:
tuttle@shangrila:~$ fuser -a /home/tuttle
/home/tuttle:         7634c  7660c  7662c  7666c  7693c  7713c  7715c  7717c  7720c  7721c  7738c  7739c  7746c  7747c  7748c  7749c  7750c  7751c  7752c  7753c  7754c  7755c  8633c  8639c  8645c  8646c  8647c  8648c  8650c  8652c  8653c  8657c  8676c  8681c  8682c  8683c  8685c  8692c  8694c  8695c  8698c
The "c"'s mean "current directory" according to the man page.
More verbose and with "-m" option:
Code:
tuttle@shangrila:~$ fuser -mu /home
/home:                7634c(tuttle)  7660c(tuttle)  7662c(tuttle)  7666c(tuttle)  7693c(tuttle)  7713c(tuttle)  7715c(tuttle)  7717c(tuttle)  7720c(tuttle)  7721c(tuttle)  7738c(tuttle)  7739c(tuttle)  7741(tuttle)  7746c(tuttle)  7747c(tuttle)  7748c(tuttle)  7749c(tuttle)  7750c(tuttle)  7751c(tuttle)  7752c(tuttle)  7753c(tuttle)  7754c(tuttle)  7755c(tuttle)  7756(tuttle)  7757(tuttle)  7776(tuttle)  8639  8639c(tuttle)  8645  8645c(tuttle)  8646  8646c(tuttle)  8647  8647c(tuttle)  8648  8648c(tuttle)  8650  8650c(tuttle)  8652  8652c(tuttle)  8653  8653c(tuttle)  8657c(tuttle)  8676c(tuttle)  8681  8681c(tuttle)  8682  8682c(tuttle)  8683  8683c(tuttle)  8685  8685c(tuttle)  8692c(tuttle)  8694c(tuttle) 8695c(tuttle)  8698c(tuttle)  8782c(tuttle)  8831c(tuttle)  8872c(tuttle)  8875c(tuttle)
Now with -v:
Code:
tuttle@shangrila:~$ fuser -mv /home

                     USER        PID ACCESS COMMAND
/home                tuttle     7634 ..c..  gnome-session
                     tuttle     7660 ..c..  gnome-keyring-d
                     tuttle     7662 ..c..  esd
                     tuttle     7666 ..c..  gnome-smproxy
                     tuttle     7693 ..c..  metacity
                     tuttle     7713 ..c..  gnome-panel
                     tuttle     7715 ..c..  gnome-volume-ma
                     tuttle     7717 ..c..  nautilus
                     tuttle     7720 ..c..  nautilus
                     tuttle     7721 ..c..  nautilus
                     tuttle     7738 ..c..  gnome-panel
                     tuttle     7739 ..c..  gnome-panel
                     tuttle     7741 f....  evolution-data-
                     tuttle     7746 ..c..  nautilus
                     tuttle     7747 ..c..  nautilus
                     tuttle     7748 ..c..  nautilus
                     tuttle     7749 ..c..  nautilus
                     tuttle     7750 ..c..  nautilus
                     tuttle     7751 ..c..  nautilus
                     tuttle     7752 ..c..  nautilus
                     tuttle     7753 ..c..  nautilus
                     tuttle     7754 ..c..  nautilus
                     tuttle     7755 ..c..  nautilus
                     tuttle     7756 f....  evolution-data-
                     tuttle     7757 f....  evolution-data-
                     tuttle     7776 f....  evolution-data-
                     tuttle     8639 f.c..  evolution-2.2
                     tuttle     8645 f.c..  evolution-2.2
                     tuttle     8646 f.c..  evolution-2.2
                     tuttle     8647 f.c..  evolution-2.2
                     tuttle     8648 f.c..  evolution-2.2
                     tuttle     8650 f.c..  evolution-2.2
                     tuttle     8652 f.c..  evolution-2.2
                     tuttle     8653 f.c..  evolution-2.2
                     tuttle     8657 ..c..  firefox
                     tuttle     8676 ..c..  run-mozilla.sh
                     tuttle     8681 f.c..  firefox-bin
                     tuttle     8682 f.c..  firefox-bin
                     tuttle     8683 f.c..  firefox-bin
                     tuttle     8685 f.c..  firefox-bin
                     tuttle     8692 ..c..  gnome-terminal
                     tuttle     8694 ..c..  bash
                     tuttle     8695 ..c..  gnome-terminal
                     tuttle     8698 ..c..  gnome-terminal
                     tuttle     8782 ..c..  bash
                     tuttle     8831 ..c..  bash
                     tuttle     8872 ..c..  man
                     tuttle     8875 ..c..  sh
edit: the -m option refers to a mounted file system, ie. all files used in that partition (I think).

Last edited by Tuttle; 08-09-2005 at 02:27 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a single command to list all hardware installed (command line)? davee Linux - Hardware 6 02-28-2009 08:19 PM
Require Linux/Perl equivalent command for windows Command alix123 Programming 7 08-19-2005 03:23 AM
lsof and fuser do not work with /dev/dsp alexrait1 Slackware 4 10-09-2004 05:07 PM
fuser problem linuxxunil Debian 4 09-14-2004 12:02 PM
Key stroke/command to shut down x and go into the command prompt screen? Fear58 Linux - General 1 07-14-2004 08:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration