- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Unix Command needed
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 01:23 AM
11-27-2002 01:23 AM
Unix Command needed
I've used this command:
$ ps -aef | grep PAYXTR.LIS
===============================================
ebokoko 21248 21232 0 10:22:15 pts/tk 0:00 vi /consult/6/runs/users/S.O./PAYXTR.LIS
con6 21156 20746 0 10:18:04 pts/tf 0:00 vi /consult/6/users/S.O./PAYXTR.LIS
root 21227 21192 0 10:20:53 pts/tj 0:00 vi PAYXTR.LIS
===============================================
Thanks.
E.Armand-Blaise
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 01:27 AM
11-27-2002 01:27 AM
Re: Unix Command needed
Are you perhaps looking for "fuser -cu" ?
Check "man fuser".
Regards,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 01:29 AM
11-27-2002 01:29 AM
Re: Unix Command needed
perhaps the LSOF utility will help:
$ lsof +aL1 /usr
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
tail 2790 root 0r VREG 64,0x4 13394720 97 /home (/dev/vg00/lvol4)
You can download it by:
http://hpux.asknet.de/hppd/hpux/Sysadmin/lsof-4.64/
Or perhaps the FUSER command helps also?! ;-)
Please try it.
Best regards,
Armin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 01:29 AM
11-27-2002 01:29 AM
Re: Unix Command needed
You can use fuser -u file_name. This shows the users and pids that have access to the file/directory.
HTH, Vicente.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 01:31 AM
11-27-2002 01:31 AM
Re: Unix Command needed
Try using fuser to list processes that have the file open, e.g.
# fuser /var/adm/syslog/syslog.log
/var/adm/syslog/syslog.log: 410o
# ps -fp 410
UID PID PPID C STIME TTY TIME COMMAND
root 410 1 0 Nov 24 ? 0:01 /usr/sbin/syslogd -D
#
Rgds, Robin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 01:33 AM
11-27-2002 01:33 AM
Re: Unix Command needed
check the lsof for 64 bit here
ftp://coast.cs.purdue.edu/pub/tools/unix/sysutils/lsof/binaries/hpux/
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 01:37 AM
11-27-2002 01:37 AM
Re: Unix Command needed
The preview command "fuser" is looking for a file system mounted on this file "PAYXTR.LIS". However, how to know exactly that a file is locked by a user (file in a specific directory).?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 01:59 AM
11-27-2002 01:59 AM
Re: Unix Command needed
For the utility, I can't use it because I'm running the B.11.00 32 bits.
Many thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 02:04 AM
11-27-2002 02:04 AM
Re: Unix Command needed
if you are looking vor 'lsof', please go to following URL:
http://hpux.asknet.de
and search for 'lsof', I'm sure you will find a version for HPUX 11.00 (32bit).
Regards,
Armin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 02:13 AM
11-27-2002 02:13 AM
Re: Unix Command needed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 04:09 AM
11-27-2002 04:09 AM
Re: Unix Command needed
I'd like to combine the both commands "fuser" and "ps -pf" . would you assist me. This is the contain of the script "BISLOCK" which receives two parameters :
$1 = /consult/6/users/S.O.
$2 = PAYXTR.LIS
==============================================
i=0
directory=$1;export directory
payxtract=$2;export payxtract
files=`echo $directory"/"$payxtract`;export files
LOOP=y; export LOOP
#
while [ $LOOP = y ]
do
# -- Verify that $2 is not locked
by an Online User --
i=`ps -aef |grep $files|wc -l`
# if the return value is not 0 then
the file is in use.
if [[ $i != 0 ]]
then
{echo ERROR CYBMON Problem
Accessing File $2
sleep 20
}
else
LOOP=n; export LOOP
break
fi
#
done
#
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 04:18 AM
11-27-2002 04:18 AM
Re: Unix Command needed
lsof is the perfect tool - no, realy - to dig into problems you face. Both fuser and ps do not offer enough interface options to get to the bones. lsof does. Learn to use lsof. Install it yesterday.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2002 11:14 AM
11-27-2002 11:14 AM
Re: Unix Command needed
If you want to see the busy files in a directory:
cd /directory
fuser * .??*
lsof is much more functional and returns more information than fuser however fuser works fine for simple checks.
Darrell