Sponsored Content
Full Discussion: Find and lsof
Top Forums Shell Programming and Scripting Find and lsof Post 302287998 by Arunprasad on Monday 16th of February 2009 07:35:22 AM
Old 02-16-2009
Java

Hi gauravacl,

PID is "1425492", and now i want to find the exact file which is bigger in size and also it is opened by the process id. But when i tried your option i am getting the output as below,

myserv123>lsof -p 1425492
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sas 1425492 ampsys cwd VDIR 46,42001 0 4043309312 /home/usr/SAS/IntTech (/dev/vx/dsk/)
sas 1425492 ampsys 0r VCHR 2,2 0t0 16628 /dev/null
sas 1425492 ampsys 1w FIFO 0xf1000100b2a35eb0 0
sas 1425492 ampsys 2w FIFO 0xf1000100b2a35eb0 0
sas 1425492 ampsys 3u IPv4 0xf10002000cabc398 0t0 TCP *:* (CLOSED)
sas 1425492 ampsys 5u unix 0xf10002000cbc7008 0t0 ->0xf10002000142c408
sas 1425492 rampsys 8u unix 0xf10002000ce2d808 0t0 ->0xf10002000d809008


It is giving many lines and i cannot see the exact file which is bigger in the file system..

My Problem and target is:
Have to find the biggest file or fastly growing file in the file system and from that take the process id and the file name (with complete path). Then my action is to send a mail to corresponding user and have to kill the process by process id and have to remove the file (bigger or growing one which belongs to the process id).

Please help me.
Thanks for your help.
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

lsof output

I have a number of open files connecting to the rpcbind process running on HPUX 11.00. Usinf lsof -p rpcbind I am unable to identify the ip addresses of the open files. Example of one below - Any ideas? rpcbind 19754 root 100u inet 72,0x72 0t0 TCP 79.60.53.40:* (BOUND) (2 Replies)
Discussion started by: Malcolmm
2 Replies

2. Filesystems, Disks and Memory

lsof

Could someone please give me a step for a hint on which version and where is the above utility is for version 4.3.3.0 of Aix. (1 Reply)
Discussion started by: jacl
1 Replies

3. UNIX for Dummies Questions & Answers

lsof ???

Hi All, I'm having a problem with "lsof" in HP-UX system. Its giving me 2 two different results when running it. 1 . lsof -p 'PID' | wc -l -----gives some value 2 . lsof | grep 'PID' | wc -l The above two commands gives me two different values with the same PID...... Thanks (6 Replies)
Discussion started by: marc
6 Replies

4. HP-UX

lsof equivalent in HP-UX

I need lsof equivalent in HP-UX. I do not want to add lsof utility separately. (1 Reply)
Discussion started by: deo_kaustubh
1 Replies

5. Shell Programming and Scripting

How to link lsof and find cmd?

Hi All, My target is to find the biggest files opened by any process and from that i have to find process id and the corresponding file also to avoid file system being hung-up. Finding the process id: is to kill the process Finding the biggest file: is to remove the file To get the process... (0 Replies)
Discussion started by: Arunprasad
0 Replies

6. UNIX for Advanced & Expert Users

lsof and have to find file, pid

Hi All, My target is to find the biggest files opened by any process and from that i have to find process id and the corresponding file also. To get the process id which is accessing the biggest file in the given file system, i am using the below command. pid=`lsof -s /home/arun/my_work |... (4 Replies)
Discussion started by: Arunprasad
4 Replies

7. UNIX for Dummies Questions & Answers

lsof

I'm looking to list all of the files open at a certain time up on a UNIX box. From looking on the internet, it looks as though lsof is the most common. However have tried this and got the following: ksh: lsof: not found Now having gone into bash mode and hit tab twice I see that lsof... (3 Replies)
Discussion started by: meevagh
3 Replies

8. UNIX for Dummies Questions & Answers

about lsof

Hi, I typed lsof -i :80 in my putty but i am not able to get sockets related to port 80 Can any one help me out soon Can anyone point out the reason for not able to get the related sockets Output of what i am getting in my putty is displayed below training@use:~> lsof -i :80... (4 Replies)
Discussion started by: satheeshkr_cse
4 Replies

9. HP-UX

lsof in HP-UX

In Linux and Solaris lsof accepts the -X switch which allows to see if deleted files are still in use and eat disk space. In HP-UX it is now working and it is a problem... today one of my filesystems on the server was increasing very fast but existing file sizes were not really changing. lsof shows... (3 Replies)
Discussion started by: Vorb
3 Replies

10. OS X (Apple)

Lsof output

This is abridged lsof output from my safari process: Safari 13063 owner 9u unix 0x982ef3b9c1be1293 0t0 ->0x982ef3b9b7534eab Safari 13063 owner 10u unix 0x982ef3b9c1be0933 0t0 ->0x982ef3b9c1be1423 Safari 13063 owner 11u unix 0x982ef3b9c1be1423 ... (1 Reply)
Discussion started by: sakurashinken
1 Replies
mysqlreport(1)							       MYSQL							    mysqlreport(1)

NAME
mysqlreport - Makes a friendly report of important MySQL status values SYNTAX
mysqlreport [options] DESCRIPTION
mysqlreport makes a friendly report of important MySQL status values. Actually, it makes a friendly report of nearly every status value from SHOW STATUS. Unlike SHOW STATUS which simply dumps over 100 values to screen in one long list, mysqlreport interprets and formats the values and presents the basic values and many more inferred values in a human-readable format. Numerous example reports are available at the mysqlreport web page at http://hackmysql.com/mysqlreport. The benefit of mysqlreport is that it allows you to very quickly see a wide array of performance indicators for your MySQL server which would otherwise need to be calculated by hand from all the various SHOW STATUS values. For example, the Index Read Ratio is an important value but it's not present in SHOW STATUS; it's an inferred value (the ratio of Key_reads to Key_read_requests). This documentation outlines all the command line options in mysqlreport, most of which control which reports are printed. This document does not address how to interpret these reports; that topic is covered in the document Guide To Understanding mysqlreport at http://hack- mysql.com/mysqlreportguide. OPTIONS
Technically, command line options are in the form --option, but -option works too. All options can be abbreviated if the abbreviation is unique. For example, option --host can be abbreviated --ho but not --h because --h is ambiguous: it could mean --host or --help. --help Output help information and exit. --user USER --password As of version 2.3 --password can take the password on the command line like "--password FOO". Using --password alone without giving a password on the command line causes mysqlreport to prompt for a password. --host ADDRESS --port PORT --socket SOCKET --no-mycnf --no-mycnf makes mysqlreport not read ~/.my.cnf which it does by default otherwise. --user and --password always override values from ~/.my.cnf. --dtq Print Distribution of Total Queries (DTQ) report (under Total in Questions report). Queries (or Questions) can be divided into four main areas: DMS (see --dms below), Com_ (see --com below), COM_QUIT (see COM_QUIT and Questions at http://hackmysql.com/com_quit), and Unknown. --dtq lists the number of queries in each of these areas in descending order. --dms Print Data Manipulation Statements (DMS) report (under DMS in Questions report). DMS are those from the MySQL manual section 13.2. Data Manipulation Statements. (Currently, mysqlreport considers only SELECT, INSERT, REPLACE, UPDATE, and DELETE.) Each DMS is listed in descending order by count. --com N Print top N number of non-DMS Com_ status values in descending order (after DMS in Questions report). If N is not given, default is 3. Such non-DMS Com_ values include Com_change_db, Com_show_tables, Com_rollback, etc. --sas Print report for Select_ and Sort_ status values (after Questions report). See MySQL Select and Sort Status Variables at http://hackmysql.com/selectandsort. --tab Print Threads, Aborted, and Bytes status reports (after Created temp report). As of mysqlreport v2.3 the Threads report reports on all Threads_ status values. --qcache Print Query Cache report. --all Equivalent to "--dtq --dms --com 3 --sas --qcache". (Notice --tab is not invoked by --all.) --infile FILE Instead of getting SHOW STATUS values from MySQL, read values from FILE. FILE is often a copy of the output of SHOW STATUS including formatting characters (|, +, -). mysqlreport expects FILE to have the format " value number " where value is only alpha and under- score characters (A-Z and _) and number is a positive integer. Anything before, between, or after value and number is ignored. mysqlreport also needs the following MySQL server variables: version, table_cache, max_connections, key_buffer_size, query_cache_size. These values can be specified in INFILE in the format "name = value" where name is one of the aforementioned server variables and value is a positive integer with or without a trailing M and possible periods (for version). For example, to specify an 18M key_buffer_size: key_buffer_size = 18M. Or, a 256 table_cache: table_cache = 256. The M implies Megabytes not mil- lion, so 18M means 18,874,368 not 18,000,000. If these server variables are not specified the following defaults are used (respec- tively) which may cause strange values to be reported: 0.0.0, 64, 100, 8M, 0. --outfile FILE After printing the report to screen, print the report to FILE too. Internally, mysqlreport always writes the report to a temp file first: /tmp/mysqlreport.PID on *nix, c:sqlreport.PID on Windows (PID is the script's process ID). Then it prints the temp file to screen. Then if --outfile is specified, the temp file is copied to OUTFILE. After --email (below), the temp file is deleted. --email ADDRESS After printing the report to screen, email the report to ADDRESS. This option requires sendmail in /usr/sbin/, therefore it does not work on Windows. /usr/sbin/sendmail can be a sym link to qmail, for example, or any MTA that emulates sendmail's -t command line option and operation. The FROM: field is "mysqlreport", SUBJECT: is "MySQL status report". --flush-status Execute a "FLUSH STATUS;" after generating the reports. If you do not have permissions in MySQL to do this an error from DBD::mysql::st will be printed after the reports. AUTHORS
Daniel Nichter If mysqlreport breaks, send me a message from http://hackmysql.com/feedback with the error. SEE ALSO
mytop(1) The comprehensive Guide To Understanding mysqlreport at http://hackmysql.com/mysqlreportguide. Daniel Nichter 2.5 2006-09-01 (docrev 2006-05-19) mysqlreport(1)
All times are GMT -4. The time now is 10:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy