Sponsored Content
Special Forums UNIX Desktop Questions & Answers How to delete files from a specific date? Post 302641217 by jim mcnamara on Tuesday 15th of May 2012 09:53:40 PM
Old 05-15-2012
based on your sample:

Code:
cd /directory
rm *05152012.log

I am assuming you mean to delete based on file name not UNIX file time/date
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

delete files in specific directory

i have a directory "ABC" with lots of old files and sub directories in it. the issue now is i want to delete away files which are older than 15 days in "ABC" without deleting the files in the sub directories and without deleting the sub directory. i tried using find command but it will drill down... (2 Replies)
Discussion started by: legato
2 Replies

2. UNIX for Dummies Questions & Answers

How to delete specific files only

Hello, I have these files in my directory. ABC123 ABC12.sls.20080809111121 ABC233 ABC12.sls.20080403123212 ABC543 ABC12.sls.20080804231212 ABC323 ABC12.sls.20080809111232 ABC765 ABC12.sls.20080809112343 ABC654 ABC12.sls.20080809113133 I want to delete only files in first... (2 Replies)
Discussion started by: i.scientist
2 Replies

3. Shell Programming and Scripting

How do I delete all files that contain specific text?

Hi all, I want to remove the files from a folder whcih contain a specific text in it. eg: If i have the files like xxxx.NAME.adadd.ajfaj.kjfha agsg.NAME.dfshd.djsh.sdjhf asgd.NAME2.sdhj.djhf.sjdhf shdd.NAME2.dhse.tywe.eyio How to remove the files which contain the pattern "NAME"... (3 Replies)
Discussion started by: sparks
3 Replies

4. Shell Programming and Scripting

Delete lines prior to a specific date in a log file.

Hi all. I have a database log file in which log data get appended to it daily. I want to do a automatic maintainence of this log by going through the log and deleting lines belonging to a certain date. How should i do it? Please help. Thanks. Example. To delete all lines prior to Jun... (4 Replies)
Discussion started by: ahSher
4 Replies

5. Shell Programming and Scripting

Delete files created before specific date.

There is a system logging a huge amount of data and we need to delete some of the older logs .I mean the files that are created before one week from today. Here is a listing of files that are sitting there: /usr/WebSphere/AppServer/logs # ls -l -rw-r--r-- 1 root system 3740694 May... (5 Replies)
Discussion started by: moustafashawky
5 Replies

6. Shell Programming and Scripting

How to delete files in specific dir

I've got a problem how to delete files from specific directory. I don't want do it recursively but only in specific directory. So, command like find /home/dirname/ -mtime +8 -type f -exec rm {} \; is not for me because this command will remove ifs files in /home/dirname and all... (2 Replies)
Discussion started by: zukes
2 Replies

7. Shell Programming and Scripting

Delete all files if another files in the same directory has a matching occurence of a specific word

Hello, I have several files in a specific directory. A specific string in one file can occur in another files. If this string is in other files. Then all the files in which this string occured should be deleted and only 1 file should remain with the string. Example. file1 ShortName "Blue... (2 Replies)
Discussion started by: premier_de
2 Replies

8. Shell Programming and Scripting

Delete file with specific date

let say i have list of file PermissionsDirectoriesGroupSizeDateDirectory or file drwx------2users4096Nov 2 19:51mailv drwxr-s---35www 32768Jan 20 22:39public_htmlt drwx------ 2 users 4096 Nov 2 19:51 mail drwxr-s--- 35 www 32768 Jan 20 22:39 public_html drwxr-s--- 35 www 32768 Jan... (3 Replies)
Discussion started by: Jewel
3 Replies

9. Shell Programming and Scripting

Delete log files content older than 30 days and append the lastest date log file date

To delete log files content older than 30 days and append the lastest date log file date in the respective logs I want to write a shell script that deletes all log files content older than 30 days and append the lastest log file date in the respective logs This is my script cd... (2 Replies)
Discussion started by: sreekumarhari
2 Replies

10. Shell Programming and Scripting

Delete all files if another files in the same directory has a matching occurrence of a specific word

he following are the files available in my directory RSK_123_20141113_031500.txt RSK_123_20141113_081500.txt RSK_126_20141113_041500.txt RSK_126_20141113_081800.txt RSK_128_20141113_091600.txt Here, "RSK" is file prefix and 123 is a code name and rest is just timestamp of the file when its... (7 Replies)
Discussion started by: kridhick
7 Replies
DESKTOP-FILE-INSTALL(1) 				      General Commands Manual					   DESKTOP-FILE-INSTALL(1)

NAME
desktop-file-install, desktop-file-edit - Installation and edition of desktop files SYNOPSIS
desktop-file-install [--dir=DIR] [-m MODE|--mode=MODE] [--vendor=VENDOR] [--delete-original] [--rebuild-mime-info-cache] [EDITOPTION]... FILE... desktop-file-edit [EDITOPTION]... FILE DESCRIPTION
The desktop-file-install program is a tool to install, and optionally edit, desktop files. The desktop-file-edit program is a tool to edit a desktop file. They are mostly useful for developers and packagers. Various options are available to edit the desktop files. The edit options can be specified more than once and will be processed in the same order as the options passed to the program. desktop-file-install and desktop-file-edit will always try to validate the resulting desktop file. A failure to validate might lead to the abortion of the installation of the desktop files. The list of registered categories and desktop environments is defined in the Menu specification: http://freedesktop.org/wiki/Specifica- tions/menu-spec. OPTIONS
The following options are supported: --dir=DIR Install desktop files to the DIR directory. -m, --mode=MODE Set the permissions of the destination files to MODE. --vendor=VENDOR Add a vendor prefix to the desktop files. If a file already has this prefix, nothing happens; else, the file will be named VENDOR- FILE. For example: if VENDOR is freedesktop.org and FILE is specification.desktop, the result file will be freedesktop.org-specifi- cation.desktop. --delete-original Delete the source desktop files, leaving only the target files. Effectively "renames" the desktop files. --rebuild-mime-info-cache Rebuild the MIME types application database after installing the desktop files. See update-desktop-database(1) for information about this database. EDIT OPTIONS
The following edit options are supported: --set-key=KEY Set the KEY key to the value passed to the next --set-value option. A matching --set-value option is mandatory. --set-value=VALUE Set the key specified with the previous --set-key option to VALUE. A matching --set-key option is mandatory. --set-name=NAME Set the name (key Name) to NAME. If a name was already set, it will be overridden. Localizations of the old name will be removed. --copy-name-to-generic-name Copy the value of the Name key to the GenericName key. Note that a desktop file requires a Name key to be valid, so this option will always have an effect. --set-generic-name=GENERIC-NAME Set the generic name (key GenericName) to GENERIC-NAME. If a generic name was already set, it will be overridden. Localizations of the old generic name will be removed. --copy-generic-name-to-name Copy the value of the GenericName key to the Name key, if the GenericName key is present. --set-comment=COMMENT Set the comment (key Comment) to COMMENT. If a comment was already set, it will be overridden. Localizations of the old comment will be removed. --set-icon=ICON Set the icon (key Icon) to ICON. If an icon was already set, it will be overridden. Localizations of the old icon will be removed. --add-category=CATEGORY Add CATEGORY to the list of categories (key Categories). If CATEGORY was already present in the list, this operation is a no-op. A non-registered category should be prefixed with X-. --remove-category=CATEGORY Remove CATEGORY from the list of categories (key Categories). If CATEGORY was not present in the list, this operation is a no-op. --add-mime-type=MIME-TYPE Add MIME-TYPE to the list of MIME types (key MimeType). If MIME-TYPE was already present in the list, this operation is a no-op. --remove-mime-type=MIME-TYPE Remove MIME-TYPE from the list of MIME types (key MimeType). If MIME-TYPE was not present in the list, this operation is a no-op. --add-only-show-in=ENVIRONMENT Add ENVIRONMENT to the list of desktop environments where the desktop files should be displayed (key OnlyShowIn). If ENVIRONMENT was already present in the list, this operation is a no-op. A non-registered desktop environment should be prefixed with X-. Note that an empty OnlyShowIn key in a desktop file means that the desktop file will be displayed in all environments. --remove-only-show-in=ENVIRONMENT Remove ENVIRONMENT from the list of desktop environments where the desktop files should be displayed (key OnlyShowIn). If ENVIRON- MENT was not present in the list, this operation is a no-op. --add-not-show-in=ENVIRONMENT Add ENVIRONMENT to the list of desktop environments where the desktop files should not be displayed (key NotShowIn). If ENVIRONMENT was already present in the list, this operation is a no-op. A non-registered desktop environment should be prefixed with X-. Note that an empty NotShowIn key in a desktop file means that the desktop file will be displayed in all environments. --remove-not-show-in=ENVIRONMENT Remove ENVIRONMENT from the list of desktop environments where the desktop files should not be displayed (key NotShowIn). If ENVI- RONMENT was not present in the list, this operation is a no-op. --remove-key=KEY Remove the KEY key from the desktop files, if present. ENVIRONMENT
Some environment variables change the behavior of desktop-file-install: DESKTOP_FILE_VENDOR This variable can be used as an alternative to the --vendor option. If the --vendor option is used, this environment variable will be ignored. DESKTOP_FILE_INSTALL_DIR This variable can be used as an alternative to the --dir option. If the --dir option is used, this environment variable will be ignored. RPM_BUILD_ROOT This variable is set when building RPM packages. If the --dir option and the DESKTOP_FILE_INSTALL_DIR environment variable are not used, it will automatically be prepended to the default install directory to install the desktop files appropriately when building packages. BUGS
If you find bugs in the desktop-file-install program, please report these on https://bugs.freedesktop.org. SEE ALSO
desktop-file-validate(1) update-desktop-database(1) FREEDESKTOP.ORG DESKTOP-FILE-INSTALL(1)
All times are GMT -4. The time now is 11:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy