I want to know if it is possible to change the same one liner so that the output is able to differentiate between a directory to a file. Maybe for example if it is a directory, it displays a * or [DIR] at the end of it.
hi all,
i'm looking for a bash or tcsh script that will clone an empty dir tree 'over' another tree ...
specifically, i'd like to:
(1) specify a src directory
(2) list the directory tree/hiearchy beneath that src dir, w/o files -- just the dirs
(3) clone that same, empty dir hierarchy to... (2 Replies)
I have to read a complete folder and if it is a file older that 7 days I have to copy it elsewhere and if it is a folder nothing to make.
The way I do it:
for I in `find /home/. -name "*" -mtime +7`
do
cp -Rf $I /home/elsewhere/.
done
Am I okay with the way I want to do it?
Help... (3 Replies)
Assume, I created one file three years back and I like to move the file to some other directory with the old date (Creation date)? Is it possible? Explain? (1 Reply)
Hi all,
if I have a dir with a mixture of files and directories in it and one of the directories *only* has read permission for the owner and I am not the owner - will I see it with an 'ls -la'.
I do not have access to a unix box at present to try this out.
Any thoughts gratefully received (1 Reply)
Hello!!
I have directories from 2008, with files in them. I want to create a script that will find the directoried from 2008 (example directory:
drwxr-xr-x 2 isplan users 1024 Nov 21 2008 FILES_112108), delete the files within those directories and then delete the directories... (3 Replies)
Just i want to ask How to search and display name of zero byte file
I have used find command but it is showing complete file path
Thanks
find . -size 0
giving me zero byte file with location
1)/home/user/a (4 Replies)
Hi there, finally i'm installed Sco Foxbase 2.1.2d over my Sco Open Server 5.0.7v server.
Well at this point almost is working fine, but, when i Run mi application i receive the next error:
"sh: the_name_of_file": does not exist".
I checked it over the Hard Disk and the file exist, the... (1 Reply)
Dear Members,
I have a list of xml files like
abc.xml.table
prq.xml.table
...
..
.
in a txt file.
Now I have to search the file(s) in all directories and sub-directories and print the full path of file in a output txt file.
Please help me with the script or command to do so.
... (11 Replies)
Hi all,
At the moment, I am doing the following to exclude some exception strings. The more I need to exclude, the longer the string becomes and it has become error prone as I edit the list manually.
$ cat output.txt
host=192.168.1.99 user=mickey
host=192.168.1.99 user=mickey... (4 Replies)
Discussion started by: newbie_01
4 Replies
LEARN ABOUT DEBIAN
tree::redblack
RedBlack(3pm) User Contributed Perl Documentation RedBlack(3pm)NAME
Tree::RedBlack - Perl implementation of Red/Black tree, a type of balanced tree.
SYNOPSIS
use Tree::RedBlack;
my $t = new Tree::RedBlack;
$t->insert(3, 'cat');
$t->insert(4, 'dog');
my $v = $t->find(4);
my $min = $t->min;
my $max = $t->max;
$t->delete(3);
$t->print;
DESCRIPTION
This is a perl implementation of the Red/Black tree algorithm found in the book "Algorithms", by Cormen, Leiserson & Rivest (more commonly
known as "CLR" or "The White Book"). A Red/Black tree is a binary tree which remains "balanced"- that is, the longest length from root to
a node is at most one more than the shortest such length. It is fairly efficient; no operation takes more than O(lg(n)) time.
A Tree::RedBlack object supports the following methods:
new ()
Creates a new RedBlack tree object.
root ()
Returns the root node of the tree. Note that this will either be undef if no nodes have been added to the tree, or a
Tree::RedBlack::Node object. See the Tree::RedBlack::Node manual page for details on the Node object.
cmp (&)
Use this method to set a comparator subroutine. The tree defaults to lexical comparisons. This subroutine should be just like a
comparator subroutine to sort, except that it doesn't do the $a, $b trick; the two elements to compare will just be the first two items
on the stack.
insert ($;$)
Adds a new node to the tree. The first argument is the key of the node, the second is its value. If a node with that key already
exists, its value is replaced with the given value and the old value is returned. Otherwise, undef is returned.
delete ($)
The argument should be either a node object to delete or the key of a node object to delete. WARNING!!! THIS STILL HAS BUGS!!!
find ($)
Searches the tree to find the node with the given key. Returns the value of that node, or undef if a node with that key isn't found.
Note, in particular, that you can't tell the difference between finding a node with value undef and not finding a node at all. If you
want to determine if a node with a given key exists, use the node method, below.
node ($)
Searches the tree to find the node with the given key. Returns that node object if it is found, undef otherwise. The node object is a
Tree::RedBlack::Node object.
min ()
Returns the node with the minimal key.
max ()
Returns the node with the maximal key.
AUTHOR
Benjamin Holzman <bholzman@earthlink.net>
SEE ALSO
Tree::RedBlack::Node
perl v5.10.0 2008-07-31 RedBlack(3pm)