Sponsored Content
Full Discussion: Find all locked files
Operating Systems AIX Find all locked files Post 302556012 by DGPickett on Friday 16th of September 2011 10:21:49 AM
Old 09-16-2011
Well, fuser tells you if anyone else has it open. Not sure anyone has a lock scanner. The fcntl() call can ask if a lock is possible, so it can detect locks, but does not actually display locks. Ditto for lockf() F_TEST. I guess you could write an app to stat a file name from the command line and fcntl f_GETLK the whole file for either read or write per command line options.

Last edited by DGPickett; 09-16-2011 at 11:30 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

deleting locked files

I have some locked files ( locked via the Mac finder) I have tired rm -R and rm -rdf but it doesnt delete the locked files just says "override rw------- etc?" type "yes" and says "operation not permitted" is there some way to do this (or unlock the files) Thanks (1 Reply)
Discussion started by: Aussie John
1 Replies

2. Shell Programming and Scripting

Find files older than 20 days & not use find

I need to find files that have the ending of .out and that are older than 20 days. However, I cannot use find as I do not want to search in the directories that are underneath the directory that I am searching in. How can this be done?? Find returns files that I do not want. (2 Replies)
Discussion started by: halo98
2 Replies

3. Shell Programming and Scripting

Little bit weired : Find files in UNIX w/o using find or where command

Yes , I have to find a file in unix without using any find or where commands.Any pointers for the same would be very helpful as i am beginner in shell scritping and need a solution for the same. Thanks in advance. Regards Jatin Jain (10 Replies)
Discussion started by: jatin.jain
10 Replies

4. UNIX for Dummies Questions & Answers

find locked files, print file path, unlock file

using OS X and the Terminal, I'd like to find all locked files in a specified directory, unlock them, and print a list of those files that were unlocked how can I do this? I'm familiar with chflags nouchg for unlocking one file but not familiar with unix enough to do what I'd like. Thanks! (0 Replies)
Discussion started by: alternapop
0 Replies

5. UNIX for Dummies Questions & Answers

I have files that are locked up...

Here's the story: I had an LaCie Internet Space (1TB)... Recently the network (or software) functions of the device just died... I tried to access it via different routers, checking UTP, tried everything possible to rule out physical damage to components. Then i got the disk out of its... (2 Replies)
Discussion started by: SentinelX
2 Replies

6. UNIX for Advanced & Expert Users

How to find locked processors

Hi all, i have no of processors .in that some processors locked. how to find the particular locked processors into list of all the processors. i hav no of processors like ex: processors 1021 1022 1023 1024 1025 ---it is locked 1026 -- - - - - -- 2334334 so i don't know 1025 is... (1 Reply)
Discussion started by: venkatreddy
1 Replies

7. Shell Programming and Scripting

what is the find to command to find the files created last 30 days

what is the find to command to find the files created last 30 days (5 Replies)
Discussion started by: rajkumar_g
5 Replies

8. UNIX for Dummies Questions & Answers

find Search - Find files not matching a pattern

Hello all, this is my first and probably not my last question around here. I do hope you can help or at least point me in the right direction. My question is as follows, I need to find files and possible folders which are not owner = AAA group = BBB with a said location and all sub folders ... (7 Replies)
Discussion started by: kilobyter
7 Replies

9. Proxy Server

Samba kill the locked files from a useraccount by multiple smbd pids

Details Samba server: Release: 5.10 Kernel architecture: sun4u Application architecture: sparc Hardware provider: Sun_Microsystems Kernel version: SunOS 5.10 Generic_142909-17 Samba version: Samba version 3.5.6 Smb.conf file section Global: # smb.conf for Airbus Industries fuer... (0 Replies)
Discussion started by: Jean-Guillaume
0 Replies

10. Shell Programming and Scripting

Find command to find a word from list of files

I need to find a word '% Retail by State' in the folder /usr/sas/reports/RetailSalesTaxallocation. When I tried like below, -bash-4.1$ cd /usr/sas/reports/RetailSalesTaxallocation -bash-4.1$ find ./ -name % Retail by State find: paths must precede expression: Retail Usage: find ... (10 Replies)
Discussion started by: Ram Kumar_BE
10 Replies
LSLOCKS(8)                                                     System Administration                                                    LSLOCKS(8)

NAME
lslocks - list local system locks SYNOPSIS
lslocks [options] DESCRIPTION
lslocks lists information about all the currently held file locks in a Linux system. OPTIONS
-i, --noinaccessible Ignore lock files which are inaccessible for the current user. -J, --json Use JSON output format. -n, --noheadings Do not print a header line. -o, --output list Specify which output columns to print. Use --help to get a list of all supported columns. The default list of columns may be extended if list is specified in the format +list (e.g. lslocks -o +BLOCKER). -p, --pid pid Display only the locks held by the process with this pid. -r, --raw Use the raw output format. -u, --notruncate Do not truncate text in columns. -V, --version Display version information and exit. -h, --help Display help text and exit. OUTPUT
COMMAND The command name of the process holding the lock. PID The process ID of the process which holds the lock. TYPE The type of lock; can be FLOCK (created with flock(2)), POSIX (created with fcntl(2) and lockf(3)) or OFDLCK (created with fcntl(2). SIZE Size of the locked file. MODE The lock's access permissions (read, write). If the process is blocked and waiting for the lock, then the mode is postfixed with an '*' (asterisk). M Whether the lock is mandatory; 0 means no (meaning the lock is only advisory), 1 means yes. (See fcntl(2).) START Relative byte offset of the lock. END Ending offset of the lock. PATH Full path of the lock. If none is found, or there are no permissions to read the path, it will fall back to the device's mountpoint and "..." is appended to the path. The path might be truncated; use --notruncate to get the full path. BLOCKER The PID of the process which blocks the lock. NOTES
The lslocks command is meant to replace the lslk(8) command, originally written by Victor A. Abell <abe@purdue.edu> and unmaintained since 2001. AUTHORS
Davidlohr Bueso <dave@gnu.org> SEE ALSO
flock(1), fcntl(2), lockf(3) AVAILABILITY
The lslocks command is part of the util-linux package and is available from https://www.kernel.org/pub/linux/utils/util-linux/. util-linux December 2014 LSLOCKS(8)
All times are GMT -4. The time now is 02:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy