12-04-2001
Modified dates to a file without the cut command
how can i write the modified dates of all of the files in my directory to a file. i dont want any of the other junk from ls in there. i cant use the cut command
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All.
Can someone please give me an example of how I'd do a comparison to find out if the last modified date of a file is newer than yesterday (i.e. today - 1 day)?
Example:
if ; then
echo "Do something..."
fi
Any ideas or examples?
Thanks. (1 Reply)
Discussion started by: dmilks
1 Replies
2. UNIX for Dummies Questions & Answers
Can you please tell me how I can list all EXE files in a dir and Subdir which where modified say before 01/01/2006 (2 Replies)
Discussion started by: fremont
2 Replies
3. UNIX for Dummies Questions & Answers
Made changes to a file using vi editor and saved those changes
now realised that the changes are not required
How can I get the previous version of the file.i.e the one which was there on which I had made changes (3 Replies)
Discussion started by: novice100
3 Replies
4. Shell Programming and Scripting
Dear All,
I am using the following script to find and replace the date format in a file. The field18 in the file has the following format: "01/26/2010 11:55:14 GMT+04:00" which I want to convert into the following format "20100126115514" for this purpose I am using the following lines of codes:... (5 Replies)
Discussion started by: bilalghazi
5 Replies
5. Shell Programming and Scripting
Hi,
I have a file which have set of rows and has to create separate files based on the id.
Eg:
001_AHaris020
001_ATony030
002_AChris090
002_ASmit060
003_AJhon001
Output: I want three files like 001_A.txt, 002_A.txt and 003_A.txt.
001_A.txt should have
... (4 Replies)
Discussion started by: techmoris
4 Replies
6. Shell Programming and Scripting
Hi
Is it possible to compare the modified dates of all the files in two directories using shell script?
I would like to take a backup of a directory in production server regularly.
Instead of copying all the files in the directory, is it possible to list only the files that are... (2 Replies)
Discussion started by: ashok.k
2 Replies
7. Shell Programming and Scripting
Hi
Can anyone what I am doing wrong while using cut command.
for f in *.log
do
logfilename=$f
Log "Log file Name: $logfilename"
logfile1=`basename $logfilename .log`
flength=${#logfile1}
Log "file length $flength"
from_length=$(($flength - 15))
Log "from... (2 Replies)
Discussion started by: dgmm
2 Replies
8. Shell Programming and Scripting
Hi
I have below requirement.
There are set of files to be monitored for audit purpose.
Source file contains the file name and its location on server.
Need to have shell script which generate a output file which is having the details of above files ( last modified user name ,lat update... (12 Replies)
Discussion started by: karnatis
12 Replies
9. UNIX for Dummies Questions & Answers
Hi All,
I am trying to print the dates that falls between 2 date variables into a file. Here is the example.
$BUS_DATE =20120616
$SUB_DATE=20120613
Output to file abc.txt should be : 20120613,20120614,120120615,20120616
Can you pls help me accomplish this in LINUX.
Thanks... (5 Replies)
Discussion started by: dsfreddie
5 Replies
10. UNIX for Beginners Questions & Answers
I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of... (9 Replies)
Discussion started by: scrutinizerix
9 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)