Sponsored Content
Full Discussion: Problem using find and xargs
Top Forums Shell Programming and Scripting Problem using find and xargs Post 302191219 by Ygor on Thursday 1st of May 2008 11:45:14 PM
Old 05-02-2008
Perhaps try something like this...
Code:
find . -type f -name '*.jpg' |\
  while read JPG
  do
    DIR=$(dirname "$JPG")/thumbs
    THUMB=$(basename "$JPG").gif
    [[ -d "$DIR" ]] || mkdir $DIR
    convert "$JPG" -format gif -thumbnail 160x160 "$DIR/$THUMB"
  done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find | xargs cat

Hai I just want to find a file *.txt in particular direcotry and display the file name puls the content. Do someone know hot to do this, thanks. I try : find test/ -name '*.txt' | xargs cat but It does'nt print out the file name, i want something below print out in my screen : test/1.txt... (4 Replies)
Discussion started by: asal_email
4 Replies

2. Solaris

Problem in using wildcard characters in xargs with find

Hi, Under my parent diectory I have directory named "Response" in many of its subfolders. I am interested to see all files with extention .pro in Response Directory. I am giving following command - find . -name "Response" -type d | xargs -i ls -lrt {}/*.pro but it is not giving result. ... (3 Replies)
Discussion started by: sanjay1979
3 Replies

3. Shell Programming and Scripting

find | xargs cat

Hi, I am having trouble getting a combination of commands to work. I need to traverse through all sub-directories of a certain directory and 'cat' the contents of a particular file in the sub-directories. The commands on their own work but when I combine them I get no output. The... (4 Replies)
Discussion started by: DownunderDave
4 Replies

4. Solaris

Piping results of 'ls' to 'find' using 'xargs'

I'm trying to get a count of all the files in a series of directories on a per directory basis. Directory structure is like (but with many more files): /dir1/subdir1/file1.txt /dir1/subdir1/file2.txt /dir1/subdir2/file1.txt /dir1/subdir2/file2.txt /dir2/subdir1/file1.txt... (4 Replies)
Discussion started by: MartynAbbott
4 Replies

5. UNIX for Dummies Questions & Answers

XARGS and FIND together

I am trying to delete files older than 60 days from a folder: find /myfolder/*.dat -mtime +60 -exec rm {} \; ERROR - argument list too long: find I can't just give the folder name, as there are some files that I don't want to delete. So i need to give with the pattern (*.dat). I can... (3 Replies)
Discussion started by: risshanth
3 Replies

6. Shell Programming and Scripting

find and xargs

hi, i've been trying to figure this weird error but I cannot seem to know why. I am using below find command: find . \( ! -name . -prune \) -type f -mtime +365 -print The above code returns no file because no files are really more then 365 days old. However, when I use xargs, its... (9 Replies)
Discussion started by: The One
9 Replies

7. Shell Programming and Scripting

Xargs + Find Help

Guys i want to run a command to list all directories that havn't been modified in over 548 days ( 1.5 yrs ). Id like to run a script to first print what the command finds ( so i get a list of the files pre move ... i have a script set for this : find /Path/Of\ Target/Directory/ -type d -mtime... (4 Replies)
Discussion started by: modulartention
4 Replies

8. UNIX for Dummies Questions & Answers

find/xargs/*grep: find multi-line empty "try-catch" blocks - eg, missing ; not in a commented block

How can I recursively find all files in a directory and print out the file and first line number of any text blocks that match the below cases? This would seem to involve find, xargs, *grep, regex, etc. In summary, I want to find so-called empty "try-catch blocks" that do not contain code... (0 Replies)
Discussion started by: lifechamp
0 Replies

9. Shell Programming and Scripting

xargs vs exec with find:

Hi All, i'm trying to create a tar of all the .txt files i find in my dir . I've used xargs to acheive this but i wanted to do this with exec and looks like it only archives the last file it finds . can some one advice what's wrong here : find . -type f -name "*.txt" -print0 | xargs -0... (9 Replies)
Discussion started by: Irishboy24
9 Replies

10. Shell Programming and Scripting

Help with find, xargs and awk

Hi, I want to find some files and then search for some lines in it with a particular pattern and then write those lines into a file. To do this I am using something like this from command prompt directly. cd /mdat/BVG find -name "stmt.*cl" -newer temp.txt | xargs -i awk '/BVG-/{print}' {} >... (7 Replies)
Discussion started by: Sandhya Harsh
7 Replies
CTHUMB(1)						      General Commands Manual							 CTHUMB(1)

NAME
cthumb - a themable web picture album generator SYNOPSIS
cthumb -c [options] imagefile ... > file.album cthumb [options] file.album DESCRIPTION
Cthumb creates themable web picture albums with thumbnails of all the pictures, comments for each picture, etc. Cthumb allows you to cre- ate web picture albums, i.e. collections of digital pictures, with small thumbnails of your pictures and with captions. In addition, it allows you to have several views of the collection of pictures. An album is composed of a series of pages, each composed of a collection of pictures. For each album page may optionally have two or more versions, like for instance in English, Spanish, German, French, etc. So your visitors would go into the English version of the web album, into the Spanish version, etc. Typically (this is what I use it for and why I wrote the program), you accumulate lots and lots of digital pictures and you need to label them and sort them out. Perhaps also you have friends and family that speak different languages. This program lets you very easily make picture albums and have the same pictures labelled in one or more languages. You can customize almost everything in the way the albums look on the screen, from the size of the thumbnails to the background and fore- ground colors, the border colors, whether you want film-strips and their picture, etc. OPERATION
Cthumb has two modes of operation. The first one, which is active when option -c is specified, prints an album file, via stdout, comprising all the images given as arguments to the command line. This is the first thing you need to do if you have never tried this program before, just to get you started. Once you have an album file, you edit it and put comments to the pictures, titles to the album pages, etc. In this mode, all the provided options in the command line will be passed through to the album file. See the format of the album file in section ALBUM FILES below. The second mode is the regular mode, the one that actually creates web pages, given the album file, so it is the one that does the real work of the script. Given an album file, cthumb generates web pages containing picture albums and an index with links to all the albums generated. Cthumb creates several HTML files, one per "Page" in the album. Check the README file (probably in /usr/doc/cthumb*/README) for more detailed info. OPTIONS
-c <files> Create an album file with the files listed and spit it out in stadard out. -l <n> Do pages in <n> languages. -f <n> Go into film mode (<n> thumbnails per row). -r Force re-generation of all thumbnails (slow). -x <n> Make thumbnail width <n>. -y <n> Make thumbnail height <n>. -n In film mode, don't generate the strips. -m Don't generate a main index file. -k Generate text captions under the thumbnails. -t Check the thumbnail width/height from the thumbnail image itself. This is slow. -b Put the bytes of the main picture in the caption. FILES
By default cthumb creates the following files (foo being the name of the album file): foo-index.html The table of contents. ALBUM FILES
Album files have a simple, textual format. First, comments in the file are started by the # character and last to the end of the line. The best way to find out the format is to use the -c <files> option for album creation mode, which outputs an album file in stdout. PER-USER VARIABLES cthumb allows users to have their own variable settings in $HOME/.cthumbrc which is read and interpreted by perl. If perl cannot parse the file, cthumb will complain rather dryly that there is a parse error in the file. VERSION
This is cthumb version 4.2. The latest version of cthumb can be found at this URL: http://puchol.com/cpg/software/cthumb/ AUTHOR
The main author Carlos Puchol <cpg@nospam.puchol.com>. A couple of other people around the net contributed to this program. See the AUTHORS file. LICENSE
This program is released under the GNU GPL license. COPYRIGHT
Copyright by Carlos Puchol, 1999, 2001. Warranty: the usual. No guarantee whatsoever is provided. No liability whatsoever is accepted for any loss or damage of any kind resulting from any defect or inaccuracy in this information or code. SEE ALSO
perl(1), pnm(5), djpeg(1), rdjpgcom(1), cjpeg(1) BUGS
Option -r regenerates all thumbnails as the program sees them, i.e. one per language. If a picture is listed twice in the album, it will be generated double the amount of times. If you have a lot of thumbnails, this can get lengthy. A workaround is to delete the thumbnails you want re-generated and run cthumb without the -r option. 7th Edition 02/19/01 CTHUMB(1)
All times are GMT -4. The time now is 09:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy