Sponsored Content
Full Discussion: deleting locked files
Top Forums UNIX for Dummies Questions & Answers deleting locked files Post 72867 by babayeve on Wednesday 25th of May 2005 07:42:45 AM
Old 05-25-2005
sorry i don't understand file is locked. and i don't know what mac finder is. i gess it is something finding your mac address of ethernet? BUT,

1) if it is locked as in RCS (revision control system) or SCCS (source code control system) , you (hopefully owner) can unlock it " rcs -u YourFileName " see man rcs if it is installed in your system. see man sccs to learn how to unlock with sccs. unfortunately i don't know.

2) if your file is in use, you can see it with " fuser -m TheFileName or the directoryName holding it " fuser is file user. see man fuser to see how to kill the process using your file. i think it is fuser -km FileName. better investigate it yourself. If you know which process is using your file you can terminate the process with " kill " command.

3) use " lsattr YourFileName " to see the attributes of your file. it might be set as immutable or undeletable with command "chattr -i filename" or " chattr -u filename " if so you can do the opposite with " chattr +i +u filename " see man chattr or man lsattr for more detail. chattr and lsattr come with newer systems. my fedora2 has it. older systems don't

these were all i know. hope they are usefull.

regards
emil babayev
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Deleting the files

Hi, I've to delete certain files older than X days from a Maintenance server. I'm doing this using find . -name lds\* -mtime $X \ -exec ls -l {} \; find . -name lds\* -mtime $X \ -exec rm -fR {} \; As well as I've to delete the files from another FTP server which are again older than X... (0 Replies)
Discussion started by: livetaurean19
0 Replies

2. UNIX for Dummies Questions & Answers

Deleting Files

Hi, I have been working with files in emacs and a file showed up in my directories called #main.c# (the original file being main.c). However I cannot delete this #main.c# file. Any suggestions? (1 Reply)
Discussion started by: bc4
1 Replies

3. UNIX for Dummies Questions & Answers

df -k and deleting files

hi everybody, urgently need solutioin aftet i execute the command df -k, i get to see al the memory status blah blah if some file system has 95% full then what should i do and any help on how and what to do ? help really appriciated. cheers (4 Replies)
Discussion started by: ajayr111
4 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. Shell Programming and Scripting

Need help comparing two files and deleting some things in those files!

So I have two files: File1 pictures.txt 1.1 1.3 dance.txt 1.2 1.4 treehouse.txt 1.3 1.5 File2 pictures.txt 1.5 ref2313 1.4 ref2345 1.3 ref5432 1.2 ref4244 dance.txt 1.6 ref2342 1.5 ref2352 1.4 ref0695 1.3 ref5738 1.2 ref4948 1.1 treehouse.txt 1.6 ref8573 1.5 ref3284 1.4 ref5838... (24 Replies)
Discussion started by: linuxkid
24 Replies

6. 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

7. Shell Programming and Scripting

AIX system.... deleting files in remote directory after retrieving files

Hi Friends, I am new to this , I am working on AIX system and my scenario is to retrive the files from remote system and remove the files from the remote system after retreving files. I can able to retrieve the files but Can't remove files in remote system. Please check my code and help me out... (3 Replies)
Discussion started by: vinayparakala
3 Replies

8. AIX

Find all locked files

How to can find all locked files and release the locks in Unix? We have an issue were an ftp job lands files under /home/loginid at 5:30 pm and at 6 pm we run a get file on the mvs mainframe machine ftp the file from the server to the mainframe. We get an error file is in use eventhu it is not !!... (4 Replies)
Discussion started by: mrn6430
4 Replies

9. Shell Programming and Scripting

Bash script deleting my files, and editing files in subdirectories question

#!/bin/bash # name=$1 type=$2 number=1 for file in ./** do if then filenumber=00$number elif then filenumber=0$number fi tempname="$name""$filenumber"."$type" if (4 Replies)
Discussion started by: TheGreatGizmo
4 Replies

10. 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
_lwp_mutex_lock(2)						   System Calls 						_lwp_mutex_lock(2)

NAME
_lwp_mutex_lock, _lwp_mutex_unlock, _lwp_mutex_trylock - mutual exclusion SYNOPSIS
#include <sys/lwp.h> int _lwp_mutex_lock(lwp_mutex_t *mp); int _lwp_mutex_trylock(lwp_mutex_t *mp); int _lwp_mutex_unlock(lwp_mutex_t *mp); DESCRIPTION
These functions serialize the execution of lightweight processes. They are useful for ensuring that only one lightweight process can exe- cute a critical section of code at any one time (mutual exclusion). LWP mutexes must be initialized to 0 before use. The _lwp_mutex_lock() function locks the LWP mutex pointed to by mp. If the mutex is already locked, the calling LWP blocks until the mutex becomes available. When _lwp_mutex_lock() returns, the mutex is locked and the calling LWP is the "owner". The _lwp_mutex_trylock() function attempts to lock the mutex. If the mutex is already locked it returns with an error. If the mutex is unlocked, it is locked and _lwp_mutex_trylock() returns. The _lwp_mutex_unlock() function unlocks a locked mutex. The mutex must be locked and the calling LWP must be the one that last locked the mutex (the owner). If any other LWPs are waiting for the mutex to become available, one of them is unblocked. RETURN VALUES
Upon successful completion, 0 is returned. A non-zero value indicates an error. ERRORS
If any of the following conditions are detected, _lwp_mutex_lock(), _lwp_mutex_trylock(), and _lwp_mutex_unlock() fail and return the cor- responding value: EINVAL The mp argument points to an invalid LWP mutex. EFAULT The mp argument points to an illegal address. If any of the following conditions occur, _lwp_mutex_trylock() fails and returns the corresponding value: EBUSY The mp argument points to a locked mutex. SEE ALSO
Intro(2), _lwp_cond_wait(2) SunOS 5.11 30 Jul 1992 _lwp_mutex_lock(2)
All times are GMT -4. The time now is 04:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy