Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Delete all files created in specific year Post 303036574 by sp23029 on Wednesday 3rd of July 2019 06:32:04 AM
Old 07-03-2019
Delete all files created in specific year

I have more than 200K files created in year 2017 under directory having size of 50GB.
I want to all these files in one shot.
Is there any faster option available with find command to delete all these file ?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

delete compressed files from year 2005

I'm trying to delete files that were created/modified in the year 2005 that we compressed and have the .Z extension on them. I tried using the awk utility but the syntax is incorrect. I don't know how to use a wildcard to capture all the compressed files. Here's the code I used ( ls -lR |... (5 Replies)
Discussion started by: igidttam
5 Replies

2. Filesystems, Disks and Memory

How to list files with specific created date

Hi, Would like to ask, which command is used to list all the files for specific date (says 1st May) and its size, for all files (including its subdirectory), in a mounted NFS disk to HP-UX. I would like to check for the total files came into my disk on 1st May. Very much appreciating your... (2 Replies)
Discussion started by: Draculla
2 Replies

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

4. UNIX for Dummies Questions & Answers

Delete files by year

can someone provide a command to delete files by year? I have several files created last year 2009. Im trying to list first ls -lrt | grep '/2009/ {print $10}' by it returns no result. Pls advise (2 Replies)
Discussion started by: lhareigh890
2 Replies

5. Shell Programming and Scripting

Delete all the files and subdirectories for the year 2006

Hi I have lot of files and subdirectories inside a directory which are created in the years 2006, 2007, 2008, 2009 and 2010. I want to delete all the files and subdirectories belonging to the year 2006 alone. How can I do that ? (5 Replies)
Discussion started by: samsungsamsung
5 Replies

6. Shell Programming and Scripting

Delete files older than 1 year through FTP

Hi All, I want to login to a remote server using FTP command and then check for files older than 1 year and delete those files. Please let me know how can i achieve this using Unix Commands. Thanks in Advance, (10 Replies)
Discussion started by: HemaV
10 Replies

7. Shell Programming and Scripting

Listing the file name and no of records in each files for the files created on a specific day

Hi, I want to display the file names and the record count for the files in the 2nd column for the files created today. i have written the below command which is listing the file names. but while piping the above command to the wc -l command its not working for me. ls -l... (5 Replies)
Discussion started by: Showdown
5 Replies

8. Shell Programming and Scripting

Delete files using year

Hi All, how can i delete files from my Unix directory on the basis of year, i have files from 2001 to till 2014, but from their, i have to delete only 2013 file.Below is my file name rwxrwxrwx 1 guopt users 5169 Jul 12 00:30 grt592_20130712003000.SAP Thanks Kki (2 Replies)
Discussion started by: kki
2 Replies

9. Shell Programming and Scripting

Script needed to delete to the list of files in a directory based on last created & delete them

Hi My directory structure is as below. dir1, dir2, dir3 I have the list of files to be deleted in the below path as below. /staging/retain_for_2years/Cleanup/log $ ls -lrt total 0 drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2 drwxr-xr-x 2 root ... (2 Replies)
Discussion started by: prasadn
2 Replies

10. Shell Programming and Scripting

Files created on specific time

Hello Gurus, I am facing one issue to get a file for a specific time. There are about 300 files created between 6.30 pm to 7.15 pm everyday. Now I wanted only the file which is created on 6.45pm. No other files required. I have used "find" command to get the files, but not getting the expected... (3 Replies)
Discussion started by: pokhraj_d
3 Replies
pack(1) 						      General Commands Manual							   pack(1)

Name
       pack, pcat, unpack - compress and expand files

Syntax
       pack [ - ] [ -f ] name...

       pcat name...

       unpack name...

Description
       The  command stores the specified files in a compressed form.  Wherever possible (and useful), each input file name is replaced by a packed
       file name.z with the same access modes, access and modified dates, and owner as those of name.  The  -f	option	forces	packing  of  name.
       Using  this option you can cause an entire directory to be packed even if some of the files cannot benefit from it.  If is successful, name
       is removed.  Packed files can be restored to their original form using or

       The command uses Huffman (minimum redundancy) codes on a byte-by-byte basis.  If a hyphen (-) is used as an argument, an internal  flag	is
       set that causes the number of times each byte is used, its relative frequency, and the code for the byte to be printed on the standard out-
       put.  Additional occurrences of a hyphen (-) in place of name causes the internal flag to be set and reset.

       The amount of compression obtained depends on the size of the input file and the character frequency distribution.  Because a decoding tree
       forms  the first part of each .z file, it is usually not worthwhile to pack files smaller than three blocks, unless the character frequency
       distribution is skewed, which may occur with printer plots or pictures.

       Typically, text files are reduced to 60-75% of their original size.  Load modules, which use a larger character set and have a more uniform
       distribution of characters, show little compression.  The packed versions are about 90% of the original size.

       The command returns a value that is the number of files that it failed to compress.

       No packing occurs if one of the following is true:

       o    The file appears packed.

       o    The file name exceeds 12 characters.

       o    The file has links.

       o    The file is a directory.

       o    The file cannot be opened.

       o    No disk storage blocks can be saved by packing.

       o    A file called already exists.

       o    The .z file cannot be created.

       o    An I/O error occurred during processing.

       The  last  segment of the file name must not exceed 12 characters to allow space for the appended .z extension.	Directories cannot be com-
       pressed.

       The command does for packed files what does for ordinary files, except that can not be used as a filter.  The specified files are  unpacked
       and written to the standard output.  Thus, to view a packed file named name.z use:
       pcat name.z
       or just:
       pcat name
       To make an unpacked copy, say nnn, of a packed file named (without destroying name.z) use the command:
       pcat name >nnn
       The command returns the number of files it was unable to unpack.  Failure may occur if:

	      the file name (exclusive of the .z) has more than 12 characters;
	      the file cannot be opened;
	      the file does not appear to be the output of pack.

       The  command expands files created by For each file name specified in the command, a search is made for a file called name.z (or just name,
       if name ends in .z).  If this file appears to be a packed file, it is replaced by its expanded version.	The new file  has  the	.z  suffix
       stripped from its name, and has the same access modes, access and modification dates, and owner as those of the packed file.

       The  command returns a value that is the number of files it was unable to unpack.  Failure occurs for the same reasons that it occurs in as
       well as for the following:

	      a file with the unpacked name already exists;
	      if the unpacked file cannot be created.

       This command is present only for compatibility.	In general, the command runs faster and gives better compression.

See Also
       cat(1), compress(1)

																	   pack(1)
All times are GMT -4. The time now is 07:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy