Sponsored Content
Top Forums UNIX for Dummies Questions & Answers problem while deleting a file Post 302120255 by Shell_Life on Tuesday 5th of June 2007 09:32:56 AM
Old 06-05-2007
Anupam,
One way you can approach this problem -- notice the "-" (dash)
between the "-f" and the regular expression for the file:
Code:
rm -f - *lock.clock
rm -f - *f.log
rm -f - *err.out

 

10 More Discussions You Might Find Interesting

1. Programming

problem deleting date-time stamped file in a directory

I have a number of files of the format filename.xfr_mmddyy_%H%M%S which i get in a specified directory daily. Now i want to search in the specified directory & delete the files which are more than 2 days old .So I use a command find $DIR/backup/* -ctime +2 -exec rm -f {} \; But after executing... (1 Reply)
Discussion started by: dharmesht
1 Replies

2. UNIX for Dummies Questions & Answers

Problem deleting file with special character

I'm having problems deleting a file with a special character and I'm hoping that somebody here can help. The file "-osample1.c" will not remove from my directory. Here is an example of what happens. Any ideas would be appreciated. > ls *sample1* ls: illegal option -- . usage: ls... (2 Replies)
Discussion started by: hart1165
2 Replies

3. UNIX for Dummies Questions & Answers

Problem while Deleting file

All, I am trying to delete a user created file from specified folder. This folder is using for my Team member (i.e, Public folder). For example, $ ls -l total 1336 -rw-rw-r-- 1 g_btha customer 2655 Dec 06 12:35 A_COL_1001 While deleting/moving this file I am getting the following... (3 Replies)
Discussion started by: nvkuriseti
3 Replies

4. UNIX for Dummies Questions & Answers

problem in deleting a file

Hello: I made this mistake on my tru64 machine, I renamed a file from: binary.errlog to binary.errlog(B3) now when im tryign to move or delete the file Im getting: # rm binary.errlog(B3) ksh: syntax error: `(' unexpected 4# mv binary.errlog(B3) log ksh: syntax error: `(' unexpected ... (3 Replies)
Discussion started by: aladdin
3 Replies

5. UNIX for Advanced & Expert Users

problem with deleting a file

hi friends, i need to delete a file named "-vyxx-.0.sdct.txt" i'm unable to use "rm -vyxx-.0.sdct.txt" jus give me your suggesstions thanks in advance (5 Replies)
Discussion started by: rprajendran
5 Replies

6. Shell Programming and Scripting

Problem in deleting lines from the file

Hi All I am not able to delete few line from long file. I have a big file which is of 53998 B in size i want to delete lines starting from 32768 to 53998 and collect remaining file in new file. It is giving exception sed: command garbled: 32768,$countd Please find the sample script... (2 Replies)
Discussion started by: rajeshorpu
2 Replies

7. Shell Programming and Scripting

Problem with deleting

Hi, I have a folder A which contains files 1,2,3... I also have a file xyz under a diff folder B containg the entries 1,2,3... I am trying to compare and delete the nonexisting ones from xyz using the below code: QFILE=/B/xyz cd A ls -1 > /tmp/file1 for fname in `cat $QFILE` do if ... (4 Replies)
Discussion started by: swasid
4 Replies

8. Shell Programming and Scripting

Problem in deleting files

Hi Guys, In one of my folders i have 10000 log files starting with sqlfile..... Iam trying to delete the log files alone from the folder using for loop but i am getting an error ksh: /usr/bin/ls: 0403-027 The parameter list is too long. For loop i used for i in `ls sqlfile*`... (4 Replies)
Discussion started by: mac4rfree
4 Replies

9. UNIX for Advanced & Expert Users

reg problem deleting file

hi, 1. When i am deleting file in the linux machine i am getting below error message. rm text.fil rm: remove regular file `text.fil'? y rm: cannot remove `text.fil': Read-only file system From su also i tried i am getting same error message. 2. Some times the file permissions and user name... (1 Reply)
Discussion started by: coconut.ramu
1 Replies

10. UNIX Desktop Questions & Answers

Problem with deleting .dmp file

Hi, everybody! I have a big problem. I don't understand Unix, but I work as a system administrator, and sometimes I make some data exports and I have to delete old .dmp files, but today I had a mistake, I wrote rm * 909* This is a part of my folder contents in unix before deleting drwxrwxr-x 2... (4 Replies)
Discussion started by: susan12
4 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 06:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy