Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 22 Oct 2014, 04:20
All times are UTC - 4
 Forum index » Taking the Puppy out for a walk » Suggestions
Anyone care to make a dotpup of lsof (LiSt Open Files)?
Moderators: Flash, Ian, JohnMurga
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
Page 1 of 1 Posts_count  
Author Message
kethd

Joined: 20 Oct 2005
Posts: 451
Location: Boston MA USA

PostPosted: 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
View user's profile Send_private_message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: 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 . . . Cool

_________________
Puppy WIKI

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: 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
View user's profile Send_private_message 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: Thu 22 Dec 2005, 04:42    Post_subject:  

lsof binary ... documentation
Back to top
View user's profile Send_private_message 
kethd

Joined: 20 Oct 2005
Posts: 451
Location: Boston MA USA

PostPosted: 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
View user's profile Send_private_message 
Display_posts:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Taking the Puppy out for a walk » Suggestions
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0541s ][ Queries: 12 (0.0057s) ][ GZIP on ]