The time now is Tue 09 Mar 2021, 05:34
All times are UTC - 4 |
Author |
Message |
kethd
Joined: 20 Oct 2005 Posts: 451 Location: Boston MA USA
|
Posted: Wed 21 Dec 2005, 21:44 Post subject:
Anyone care to make a dotpup of lsof (LiSt Open Files)? |
|
Studying I/O redirection, it seems like lsof (LiSt Open Files) is the proper utility to see what is going on. (The advanced BASH documentation uses it.) But I can't find it anywhere yet in the pupverse, and I haven't learned enough yet to be able to compile it from raw sources myself.
Would someone be willing to make it some kind of pup-pkg? Any suggestions of where I could steal a binary from some other distro that is likely to work?
What existing pup utilities give the best detailed information about open files?
= = = =
LiSt Open Files is a useful and powerful tool that will show you opened files. In Unix everything is a file: pipes are files, IP sockets are files, unix sockets are files, directories are files, devices are files, inodes are files...
http://people.freebsd.org/~abe/
http://freshmeat.net/projects/lsof/
http://www.akadia.com/services/lsof_intro.html
http://www.uwsg.iu.edu/UAU/advcomm/lsof.html
http://rootprompt.org/article.php3?article=9390
lsof
List open files. This command outputs a detailed table of all currently open files and gives
information about their owner, size, the processes associated with them, and more. Of course,
lsof may be piped to grep and/or awk to parse and analyze its results.
bash$ lsof
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
init 1 root mem REG 3,5 30748 30303 /sbin/init
init 1 root mem REG 3,5 73120 8069 /lib/ld-2.1.3.so
init 1 root mem REG 3,5 931668 8075 /lib/libc-2.1.3.so
cardmgr 213 root mem REG 3,5 36956 30357 /sbin/cardmgr
...
|
Back to top
|
|
 |
Lobster
Official Crustacean

Joined: 04 May 2005 Posts: 15588 Location: Paradox Realm
|
Posted: Wed 21 Dec 2005, 22:12 Post subject:
Re: Anyone care to make a dotpup of lsof (LiSt Open Files)? |
|
using lsof
http://dmiessler.com/study/nix/commands/lsof/
kethd wrote: |
What existing pup utilities give the best detailed information about open files?
|
Start / Control Panel / KP Running packages
- I know you are interested in command line tools but this is still useful . . .
How this is used: Sometimes (this happens with Firefox after I have about 6 open) programs are in memory but not on the desktop - you can use this to "kill 'em"
It takes a while to realise that you can clear from memory without rebooting (refresh often works too - that is just restarting JWM)
You will often notice more of a program running than is actually the case - a bug? I have heard no but am not convinved . . .
_________________ Puppy Raspup 8.2 Final
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html 
Last edited by Lobster on Thu 14 Sep 2006, 19:12; edited 1 time in total
|
Back to top
|
|
 |
GuestToo
Puppy Master
Joined: 04 May 2005 Posts: 4078
|
Posted: Thu 22 Dec 2005, 00:11 Post subject:
|
|
Quote: | You will often notice more of a program running than is actually the case |
if you mean there seem to be duplications of a process in kp or when you type ps, ps can't tell the difference between a process and a thread, so it lists all running processes and threads together
for example:
1124 root 42640 S /mnt/hda11/pup4/firefox/firefox-bin
1126 root 42640 S /mnt/hda11/pup4/firefox/firefox-bin
1127 root 42640 S /mnt/hda11/pup4/firefox/firefox-bin
1131 root 42640 S /mnt/hda11/pup4/firefox/firefox-bin
is one process (pid 1124) and 3 threads (pids 1126, 1127 and 1131)
notice they all show the same amount of memory being used ... the process and all it's threads is using 42 megs of memory ... not 42 megs of memory for each thread
killing the process (pid 1124) will kill all the threads too
url 1 ... url 2
|
Back to top
|
|
 |
GuestToo
Puppy Master
Joined: 04 May 2005 Posts: 4078
|
Posted: Thu 22 Dec 2005, 04:42 Post subject:
|
|
lsof binary ... documentation
|
Back to top
|
|
 |
kethd
Joined: 20 Oct 2005 Posts: 451 Location: Boston MA USA
|
Posted: Thu 22 Dec 2005, 10:28 Post subject:
|
|
THANK YOU, GuestToo!
I was nervous about the "i686" label, since I am running on PI (233-MMX), but that binary actually seems to work! Now I can pursue my crazy efforts to understand pipes, fifos, and IO-redirection...
(And that source package seems way past my current level -- I've never compiled anything in Linux, and I assume I would need the Puppy development package to compile lsof?)
Getting a list of all these open file details is wonderful. Too bad the lsof binary is 100K. Probably too big for standard image.gz, or standard usr_cram.fs. But maybe worth including in the standard development cram.fs.
|
Back to top
|
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|