Deleting the file except one type of file


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Deleting the file except one type of file
# 8  
Old 12-18-2008
thanks a lot.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Deleting file basing on the timestamp substring in the file name

Hello, I have in my backup folder, files with names convention like this : randomFileNames_13-02-2014_23h13m09+1392333189 randomFileNames_14-02-2014_02h13m09+1392343989 randomFileNames_14-02-2014_04h13m09+1392351189 etc.... Base on timestamp at end of the filename, I would to delete all the... (7 Replies)
Discussion started by: thuyetti
7 Replies

2. Shell Programming and Scripting

Shell script to read file and check file type

Hi, I have a file with few values in it. I need script help to read file line by line and check: 1/if it's a file (with extension eg .java .css .jar etc ) or 2/if it's a file without extension and treat it as a directory and then check if the directory exists in working copy else create one... (6 Replies)
Discussion started by: iaav
6 Replies

3. Shell Programming and Scripting

[solved] File type error (not a regular file)

Hi friend, i have written script as below to check the file existance. but i got error path="/k/p1100/users/jewel/Output" FILENAME=`ls -lrt $path/*HT|tail -1|cut -d "/" -f 8` if ; then echo "$FILENAME is available " chmod 755 $path/$FILENAME /usr/bin/scp... (0 Replies)
Discussion started by: Jewel
0 Replies

4. Shell Programming and Scripting

awk - writing matching pattern to a new file and deleting it from the current file

Hello , I have comma delimited file with over 20 fileds that i need to do some validations on. I have to check if certain fields are null and then write the line containing the null field into a new file and then delete the line from the current file. Can someone tell me how i could go... (2 Replies)
Discussion started by: goddevil
2 Replies

5. Shell Programming and Scripting

Deleting all files recursively from directories while ignoring one file type

Hi, Seems like I need help again with a problem: I want to delete all files from my lets say "Music" Directory inkluding all of the subfolders except for .mp3 and .MP3 files. I tried it with globalignoring mp3 files, finding and deleting all other files, which resulted in all files... (3 Replies)
Discussion started by: pasc
3 Replies

6. Shell Programming and Scripting

Deleting a type of file in a directory immediately it occurs

Hi All, I have to maintain few servers and in those servers in a specific directory some special jobs keeps on running ....... The directory is having many kind of files like.....acd*, hud*, rca*....bla bla bla....... My aim is that if due to any job-any time a file having initials like... (4 Replies)
Discussion started by: jitendra.pat04
4 Replies

7. UNIX for Advanced & Expert Users

Deleting older files of a particular type

hi This should be easy but i'm obviously missing something obvious. :) I'm looking to delete files from yesterday and older of extension .txt and there a range of subfolders with these files in them. The command runs but doesn't delete anything. SUSE 10. find /testfolder -maxdepth 2 -type f... (6 Replies)
Discussion started by: cmap
6 Replies

8. UNIX for Advanced & Expert Users

File System Type From File Path?

I'm writing a gui for the core utility shred. I want to be able to warn the user if they are about to shred a file that is on a journaled file system. In order to do this, I must learn the file system type of the path they are about to shred. Is there a way in Unix to: 1. query a specific... (3 Replies)
Discussion started by: codecellar
3 Replies

9. Shell Programming and Scripting

Deleting lines inside a file without opening the file

Hi, Just consider there are around 10 lines in a file. Now is it possible to delete the first 2 lines in the file without opening the file. No matter whatever the content of the file is, I just wanna delete the first 2 lines without opening the file. Is that possible? If so, please help me out.... (3 Replies)
Discussion started by: toms
3 Replies

10. UNIX for Dummies Questions & Answers

deleting files by type (symbolic links)

How do I delete just the symbolic links in a directory? I have files that I wish to keep that have similar names, length and date/time. Can I use file size? Thanks kyle (4 Replies)
Discussion started by: kryan_toolboy
4 Replies
Login or Register to Ask a Question
PTS_DELETE(1)						       AFS Command Reference						     PTS_DELETE(1)

NAME
pts_delete - Deletes a Protection Database entry SYNOPSIS
pts delete -nameorid <user or group name or id>+ [-cell <cell name>] [-noauth] [-localauth] [-force] [-help] pts d -na <user or group name or id>+ [-c <cell name>] [-no] [-l] [-f] [-h] DESCRIPTION
The pts delete command removes each entry specified by the -nameorid argument from the Protection Database. Deleting entries affects other parts of the system in various ways: o Deleted users and groups still appear on access control lists (ACLs), but are listed by AFS UID or GID rather than by name, because there is no longer an associated name to which to translate the ID. To remove these obsolete entries from ACLs, use the fs cleanacl command. o Deleting a user or machine's entry removes it from the membership list of any group to which it belonged. o Deleting a group entry removes it from the membership list of any user or machine entry that belonged to the group, and also increments the group-creation quota of the group's creator by one, even if the creator no longer owns the group. To remove a user or machine from a group without actually deleting the entry, use the pts removeuser command. OPTIONS
-nameorid <user or group name or ID>+ Specifies the name or AFS UID of each user, the name or AFS GID of each group, or the IP address (complete or wildcard-style) or AFS UID of each machine entry to delete. It is acceptable to mix users, machines, and groups on the same command line, as well as names (IP addresses for machines) and IDs. Precede the GID of each group with a hyphen to indicate that it is negative. -cell <cell name> Names the cell in which to run the command. For more details, see pts(1). -force Enables the command to continue executing as far as possible when errors or other problems occur, rather than halting execution at the first error. -help Prints the online help for this command. All other valid options are ignored. -localauth Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. Do not combine this flag with the -cell or -noauth options. For more details, see pts(1). -noauth Assigns the unprivileged identity anonymous to the issuer. For more details, see pts(1). EXAMPLES
The following example deletes the user entries "pat" and "terry": % pts delete pat terry The following example deletes the Protection Database entry of the group with AFS GID -215. % pts delete -215 PRIVILEGE REQUIRED
The issuer must belong to the system:administrators group to delete user and machine entries. To delete group entries, the issuer must either own the group or belong to the system:administrators group. SEE ALSO
fs_cleanacl(1), pts(1), pts_removeuser(1) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2014-04-08 PTS_DELETE(1)