Well, first, I don't see why you need "ls -lrt". Do they need to print in date order?
But I still agree with isacs:
That will find only files (not directories) in /your/dir that have the word "date" before some numbers, then send each one to the line printer in the order in which it finds them.
Look at the name page for find for all finds of options, including ones to keep the search in the /your/dir directory, instead of trying to keep searching below it.
Hi,
I need to get some files from a server via ftp. normaly I use following scrip, it is worrking fine.
cd dir_name
ftp -v -n "10.76.170.17" << cmd
user "rbi" "rbi"
cd recordreceive
prompt... (0 Replies)
i have a file called file1
cat file1
i am namish
namish lives in India
India and namish both are good.
I want to delete all the occurences of namish in one shot,if i do it with sed i guess all the lines will be deleted containing the pattern.Suggest me any idea without AWK.
Thanks... (6 Replies)
Okay, so im setting up a script to start my internet dependent scripts once I am connected to the net. It got complicated because of the different networks I frequent but it goes something like this:
n=1
iwconfig wlan0 > wireless.txt
m= grep -c MGHS /home/jake/Scripts/wireless.txt
o= grep -c... (7 Replies)
i have a dir called logs. In it i have some 350 files how to move all those files from directory logs to a new dir called archive
I want to do it in single shot
Below the command i m trying but not getting
find . -name "CurrentCollector*" -exec mv {} archive \;... (2 Replies)
i have a directory in which i have Multiple files:
Following are they====
-rw-r--r-- 1 root root 886 Jan 21 16:38 trunkn.xsd
-rw-r--r-- 1 root root 244 Jan 21 16:38 trunknameCache.xml
-rw-r--r-- 1 root root 1240 Jan 21 16:38 subscribercache.xsd
-rw-r--r-- 1 root ... (1 Reply)
Is this possible?
#!/bin/ksh
for file in `*.idlesince`
do
while read inter time
do
printf "%s %s\n" "${inter}" "$(perl -e 'print scalar localtime('"${time}"') . "\n";')" >> "${file}.done"
done < "${file}"
done
The error I get is
line 9: router.idlesince: command not... (1 Reply)
Hi All,
requirement is to find and remove the files from sub directories but it should exclude the files from parent directory.
At present i am using the below one but it finds and remove files from both parent and sub directories.
find ${PATH} -type f \( -name securitas\* -o -name \*gz... (1 Reply)
Discussion started by: Naveenkk
1 Replies
LEARN ABOUT PHP
phar.extractto
PHAR.EXTRACTTO(3) 1 PHAR.EXTRACTTO(3)Phar::extractTo - Extract the contents of a phar archive to a directory
SYNOPSIS
public bool Phar::extractTo (string $pathto, [string|array $files], [bool $overwrite = false])
DESCRIPTION
Note
This method requires the php.ini setting phar.readonly to be set to 0 in order to work for Phar objects. Otherwise, a PharException
will be thrown.
Extract all files within a phar archive to disk. Extracted files and directories preserve permissions as stored in the archive. The
optional parameters allow optional control over which files are extracted, and whether existing files on disk can be overwritten. The sec-
ond parameter files can be either the name of a file or directory to extract, or an array of names of files and directories to extract. By
default, this method will not overwrite existing files, the third parameter can be set to true to enable overwriting of files. This method
is similar to ZipArchive.extractTo(3).
PARAMETERS
o $pathto
- Path within an archive to the file to delete.
o $files
- The name of a file or directory to extract, or an array of files/directories to extract
o $overwrite
- Set to TRUE to enable overwriting existing files
RETURN VALUES
returns TRUE on success, but it is better to check for thrown exception, and assume success if none is thrown.
ERRORS /EXCEPTIONS
Throws PharException if errors occur while flushing changes to disk.
EXAMPLES
Example #1
A Phar.extractTo(3) example
<?php
try {
$phar = new Phar('myphar.phar');
$phar->extractTo('/full/path'); // extract all files
$phar->extractTo('/another/path', 'file.txt'); // extract only file.txt
$phar->extractTo('/this/path',
array('file1.txt', 'file2.txt')); // extract 2 files only
$phar->extractTo('/third/path', null, true); // extract all files, and overwrite
} catch (Exception $e) {
// handle errors
}
?>
SEE ALSO PharData.extractTo(3).
PHP Documentation Group PHAR.EXTRACTTO(3)