Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Deleting files based on Substring match Post 302625555 by manushi88 on Wednesday 18th of April 2012 01:47:35 AM
Old 04-18-2012
Hi neutronscott,
This will remove files according to modification time but in this scenario one can modify file at any moment. So this query will not give correct results

---------- Post updated at 12:42 AM ---------- Previous update was at 12:40 AM ----------

Hi methyl,

thanks for pointing it out the typing error.Made required change

---------- Post updated at 12:47 AM ---------- Previous update was at 12:42 AM ----------

Hi 47shailesh,

$UPPDATE is a substring having todays date pattern as filename would be somewhat like this
(eg ABS_18APR2012_XYZ.csv
DSE_17APR2012_ABE.csv)
so what I am trying to do is removing all the files other than todays date pettern

but this
Code:
ls $FILE | grep -v "$UPPDATE"

will list the files who is having todays date pattern

Last edited by Scrutinizer; 04-18-2012 at 03:03 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Traversing thru dirs and deleting files based on date

Hi Folks I am pretty new to unix and shellscripting. I need help on writing logic on traversing recursively through a set of directories under a top-level folder and delete files(mostly text) which are 1 month old. Can you people help me on this? Thanks a lot Ravi (5 Replies)
Discussion started by: ravi2082
5 Replies

2. Shell Programming and Scripting

command for deleting log files based on some condition

Hello, Can anyone pls. provide me with the command for deleting files older then 15 days with a restriction to keep at least 5 files in a directory even if they are older then 15 days. Any help will be highly appreciated. Thanks, Pulkit (4 Replies)
Discussion started by: pulkit
4 Replies

3. UNIX for Dummies Questions & Answers

deleting files based on file name and modified time

Hi, I have some log files created in the following fashion Ex: file name modified date 1) s.log1 01-jan-08 2) s.log2 02-jan-08 3) s.log3 03-jan-08 4) s.log4 04-jan-08 Now I want to have the latest 2 logs and delete the others. Can you tell me the one liner /... (1 Reply)
Discussion started by: ammu
1 Replies

4. UNIX for Dummies Questions & Answers

deleting lines from a delimited files based on a 2nd file

I need a little help... I have a file with 3 fields, Time/Date, IP address, UniqueID I have a 2nd file of UniqueIDs. I want to either (which ever is easier): 1. delete entries in file 1 that have a UniqueID in file 2 2. create a new file with the fields from File 1, excluding the... (4 Replies)
Discussion started by: goldie363
4 Replies

5. Shell Programming and Scripting

Deleting the files based on the date's

I have to write one script which will delete the files in the below passion. If today is 17-Feb-2010 then the script delete only 17-JAN-2010 files from the directory. Could you please help me, How will I delete the files when the year is leap year, if today is 30th Mar 2010 then how will... (1 Reply)
Discussion started by: kandi.reddy
1 Replies

6. Shell Programming and Scripting

Deleting files based on their size

I have several files in a folder and I would like to delete the ones that do not contain all the required information (size) let say 1kb. Any ideas? (4 Replies)
Discussion started by: Xterra
4 Replies

7. UNIX for Dummies Questions & Answers

deleting files based on the suffix

how do we delete files based on the suffix??? (1 Reply)
Discussion started by: saggiboy10
1 Replies

8. Shell Programming and Scripting

Deleting lines based on a condition for a group of files

hi i have a set of similar files. i want to delete lines until certain pattern appears in those files. for a single file the following command can be used but i want to do it for all the files at a time since the number is in thousands. awk '/PATTERN/{i++}i' file (6 Replies)
Discussion started by: anurupa777
6 Replies

9. Shell Programming and Scripting

New files based off match or no match

Trying to match $2 in original_targets with $2 of new_targets . If the two numbers match exactly then a match.txt file is outputted using the information in the new_targets in the beginning 4 fields $1, $2, $3, $4 and value of $4 in the original_targets . If there is "No Match" then a no... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. UNIX for Beginners Questions & Answers

Data match 2 files based on first 2 columns matching only and join if match

Hi, i have 2 files , the data i need to match is in masterfile and i need to pull out column 3 from master if column 1 and 2 match and output entire row to new file I have tried with join and awk and i keep getting blank outputs or same file is there an easier way than what i am... (4 Replies)
Discussion started by: axis88
4 Replies
GWYDDION-THUMBNAILE(1)						     Gwyddion						    GWYDDION-THUMBNAILE(1)

NAME
gwyddion-thumbnailer - Create thumbnails of SPM data files SYNOPSIS
gwyddion-thumbnailer {--version | --help} gwyddion-thumbnailer [OPTION...] {MODE} [ARGUMENT...] DESCRIPTION
Gwyddion-thumbnailer creates thumbnails of SPM (Scanning Probe Microscope) image files. Depending on the mode of operation, described below, the thumbnails are written to conform to various desktop standards so that they can be displayed in nautilus(1), thunar(1) and similar file managers. Gwyddion-thumbnailer loads and renders files using gwyddion(1), libraries and modules, therefore, it can create thumbnails of all file formats supported by your Gwyddion installation. This also means it inherits Gwyddion settings, e.g. the default false color gradient, and that it is influenced by the same environment variables as Gwyddion. INFORMATIVE OPTIONS
--help Prints a brief help and terminates. --version Prints version information and terminates. THUMBNAILING OPTIONS
--update Writes the thumbnail only if it does not exist yet or does not seem to be up-to-date. By default, gwyddion-thumbnailer overwrites existing thumbnails with fresh ones even if they seem up to date. MODE
Three thumbnailing modes are available: gnome2, tms and kde4; and one special mode: check. They are described below. GNOME 2 gwyddion-thumbnailer [OPTION...] gnome2 MAX-SIZE INPUT-FILE OUTPUT-FILE In gnome2 mode, gwyddion-thumbnailer creates PNG thumbnails according to the Gnome thumbnailer specification. Usings the convention from this specification, it should be run gwyddion-thumbnailer gnome2 %s %i %o Gwyddion installs the corresponding GConf schemas and enables thumbnailers for all file types it supports by default, so usually this should Just Work and should not need to be set up manually. The thumbnails created in gnome2 more are identical as in tms mode, including all the PNG auxiliary chunks (provided that the same MAX-SIZE as in tms mode is specified, of course). TMS
gwyddion-thumbnailer [OPTION...] tms MAX-SIZE INPUT-FILE In tms mode, gwyddion-thumbnailer creates PNG thumbnails according to the Thumbnail Managing Standard. Argument MAX-SIZE must be 128 or normal (both meaning 128 pixels) or 256 or large (both meaning 256 pixels). Output file name is not given as it is prescribed by the TMS. The thumbnail is placed to the directory for normal or large thumbnails according to given MAX-SIZE. This mode can also be useful for manual batch-creation of thumbnails. For instance, to create them for all *.afm files in directory scans and its subdirectories, you can run find scans -type f -name '*.afm' -print0 \ | xargs -0 -n 1 gwyddion-thumbnailer --update tms normal And then go make yourself a coffee because this will take some time. KDE 4 gwyddion-thumbnailer kde4 MAX-SIZE INPUT-FILE In kde4 mode, gwyddion-thumbnailer creates PNG thumbnails that are intended to be consumed by gwythumbcreator KDE module. The thumbnail, again identical as in the other modes, is written to the standard output. Do not use this mode from the command line. It is documented for completness, however, the protocol between gwythumbcreator and gwyddion-thumbnailer must be considered private and it can change any time. CHECK
gwyddion-thumbnailer check INPUT-FILE The check mode does not serve for thumbnail creation. Instead, gwyddion-thumbnailer prints information about available thumbnails of INPUT-FILE and cached failures to produce a thumbnail by individual applications, as described by the TMS. If the normal-sized thumbnail exists and is up to date, the large version does not exist and there is one cached failure from gnome-thumbnail-factory, the output can be for instance: File: INPUT-FILE URI: file:///home/me/Pictures/naughty/broken-tip3/INPUT-FILE Normal: /home/me/.thumbnails/normal/MD5.png status: OK Large: /home/me/.thumbnails/large/MD5.png status: Thumbnail does not exist or stat() fails on it. Failed: /home/me/.thumbnails/fail/gnome-thumbnail-factory/MD5.png URI is the canonical URI of the input file, MD5 stands for the hex representation of MD5 sum of the URI, as described by the TMS. If there are no cached failures, no Failed lines are printed. This function can be used to check thumbnails of any kind, not necessarily created by gwyddion or gwyddion-thumbnailer. In future, it might be reported as an error if the thumbnail does not contain Gwyddion-specific information though. SEE ALSO
gwyddion(1), AUTHOR
Yeti Author. gwyddion 09/04/2009 GWYDDION-THUMBNAILE(1)
All times are GMT -4. The time now is 12:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy