08-13-2008
Use ls -R and then test whether it is a file
Algo
1) ls -r >> data file
2) counter =1
3) Now read line by line in while loop-- while ($ counter < no of lines in file)
if (test -f sed -n ${counter}p)
{ remove the file rm -f sed -n ${counter}p}
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I am a shell-script newbie and am looking to synchronize certain files in two directory structures.
Both these directory-trees are in CVS and so I dont want the CVS directory to be copied over.
I want only .sh and .pl files in each subdirectory under these directory trees to be... (3 Replies)
Discussion started by: sharpsharkrocks
3 Replies
2. Shell Programming and Scripting
sorry guys can some please give me a hint how to achieve this in a slick oneliner?
delete files older than 5 minutes in specified directory (recursively)
peace (3 Replies)
Discussion started by: scarfake
3 Replies
3. UNIX for Dummies Questions & Answers
Greetings,
I need to delete all files that contain the word thumbs. Those files are spread all throughout sub-directories in a file directory tree.
Is there a script or single line command that will find all files with the word thumbs, and simply delete the file?
For example:
Delete... (4 Replies)
Discussion started by: ..Chris..
4 Replies
4. Shell Programming and Scripting
I have a script which generates recursively some files in folders for a given root folder.
I have checks for permissions and it works for all folders except one(i have 777 permission on it). When i try calling the script in problematic folder(problematic folder being root folder), script works as... (2 Replies)
Discussion started by: bb2
2 Replies
5. Solaris
Display the number of files in a directory and recursively in each subdirectory
To look something like below, for example
/var 35
/var/tmp 56
/var/adm 46
Any ideas how can we do this? :wall: (1 Reply)
Discussion started by: jakerock
1 Replies
6. Solaris
Display the number of files in a directory and recursively in each subdirectory
To look something like below, for example
/var 35
/var/tmp 56
/var/adm 46Any ideas how can we do this?
Got a sun cluser global mount point which takes ages to mount everytime, need to understand... (5 Replies)
Discussion started by: jakerock
5 Replies
7. Shell Programming and Scripting
I want to recursively cat the content of files in a directory e.g.
find /etc -type f -exec cat {} \;
But I want it to print the file name first and then the content. For example let's say /etc/statetab and /etc/colord.conf will be printed first then I want the output to look something like;
... (6 Replies)
Discussion started by: lewk
6 Replies
8. Shell Programming and Scripting
I love the -newerct flag for the Cygwin find command on windows.
Can I use "/usr/bin/find . -newerct '3 hours ago'" to conditionally copy a directory tree so that only the files in the directory tree that are younger than 3 hours are copied to my destination directory such that the directory... (4 Replies)
Discussion started by: siegfried
4 Replies
9. Shell Programming and Scripting
Hi.
I found many scripts in the web of achieving this.
But I like to use this one
find /EDWH-DMT03 -xdev -size +10000 -exec ls -la {} \;|sort -n -k 5 > LARGE.rst
But the problem is, why it still list out files with 89 bytes as the output? Is there anything wrong with the command?
My... (7 Replies)
Discussion started by: aimy
7 Replies
10. Shell Programming and Scripting
I need to copy a complete directory structure into a new location. But I want to have all files copied into one directory and leave out the directory structure. So all files must be placed in one directory. (4 Replies)
Discussion started by: ReneVL
4 Replies
LEARN ABOUT DEBIAN
roar_connectionunref
roar_connectionref(3) System Manager's Manual: RoarAudio roar_connectionref(3)
NAME
roar_connectionref, roar_connectionunref - change reference counter for RoarAudio connections
SYNOPSIS
#include <roaraudio.h>
int roar_connectionref(struct roar_connection * con);
int roar_connectionunref(struct roar_connection * con);
#define roar_disconnect(x) roar_connectionunref((x))
DESCRIPTION
Those functions change the reference counter for connection objects previously opend via roar_connect(3), roar_connect_fh(3) or roar_sim-
ple_connect(3). If the reference counter hints zero the connection is closed and the object is destroyed.
The roar_disconnect(3) macro is provided to be source compatible (recompile needed) with RoarAudio 0.4 or older.
PARAMETERS
con The connection to be altered.
RETURN VALUE
On success these calls return 0. On error, -1 is returned.
EXAMPLES
FIXME
SEE ALSO
roar_simple_connect(3), libroar(7), RoarAudio(7).
RoarAudio May 2011 roar_connectionref(3)