Sponsored Content
Top Forums Shell Programming and Scripting Renameing files with the find command Post 18768 by Breen on Wednesday 3rd of April 2002 04:50:19 AM
Old 04-03-2002
Bug Renameing files with the find command

Hi,
I am attempting to rename files in a directory tree, using the find command:

find . -name "file-src*" -exec mv {} file-tgt \;

however, this only moves the file to the current dir: I have also tried:

mv 'find . -name file-src' file-tar

find . -name "file-src*" -exec mv {file-tgt} \;

etc, but to no avail. Any help would be appreciated.

Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Little bit weired : Find files in UNIX w/o using find or where command

Yes , I have to find a file in unix without using any find or where commands.Any pointers for the same would be very helpful as i am beginner in shell scritping and need a solution for the same. Thanks in advance. Regards Jatin Jain (10 Replies)
Discussion started by: jatin.jain
10 Replies

2. Shell Programming and Scripting

Deleting files using find command

I want to find the files and delete all the files except the last file. I am using find command , I am sending the find output to a file and getting all the lines except the last one and sending it to the remove command . This is not working. can anyone help me out to do it in the find command... (8 Replies)
Discussion started by: deepaklanka
8 Replies

3. UNIX for Dummies Questions & Answers

find command -- listing files twice

I noticed the other day that after i used the find command to search for some files, the computer listed them twice -- first with just the names of the files (meaning ./(then the individual file names), then with the directory name, followed by the file names (./directory name/file name). I was... (2 Replies)
Discussion started by: Straitsfan
2 Replies

4. Shell Programming and Scripting

what is the find to command to find the files created last 30 days

what is the find to command to find the files created last 30 days (5 Replies)
Discussion started by: rajkumar_g
5 Replies

5. UNIX for Dummies Questions & Answers

command to find files

Hi folks, What command/commands I have to run to find the files including their folder/subfolder which contain word-a, word-b etc. e.g. I expect to find the names of the files including their folders which contain "domain", "subdomain/sub domain", "free domain". etc. TIA B.R. satimis (11 Replies)
Discussion started by: satimis
11 Replies

6. UNIX for Dummies Questions & Answers

Command to find files

Hi All, Can anyone give me the command to copy files from 03-Mar-2013 to 07-Mar-2013 in folder. there are nearly 40+ thousand files in directory , so I just need files from Mar 3rd to Mar 7th and copy them to a location . Need quick help pls (2 Replies)
Discussion started by: rockingvj
2 Replies

7. UNIX for Dummies Questions & Answers

Find command to delete old files

Hi, I want to delete all the log files that was created on year 2008. My command is not working. Any idea? find . -name '*.log' -mtime 1460 -exec ls -lt {} \; Thank you. (2 Replies)
Discussion started by: samnyc
2 Replies

8. Shell Programming and Scripting

Find command to delete the files

Hi All, I've created 2 files touch -t 201309101234 aa10 touch -t 201309111234 aa11 Exact 60 days before from today date is SEPT 12th . As per the following command as i gave +60 means the files which were created before sept12th should be deleted find /etc/logs/*aa* -type f -atime +60... (5 Replies)
Discussion started by: smile689
5 Replies

9. Shell Programming and Scripting

Find command to find a word from list of files

I need to find a word '% Retail by State' in the folder /usr/sas/reports/RetailSalesTaxallocation. When I tried like below, -bash-4.1$ cd /usr/sas/reports/RetailSalesTaxallocation -bash-4.1$ find ./ -name % Retail by State find: paths must precede expression: Retail Usage: find ... (10 Replies)
Discussion started by: Ram Kumar_BE
10 Replies

10. Shell Programming and Scripting

Find command when there exist many files

I want to run find and wondering if it struggles when there are many files. I have tried and does not seem to complain. Is this correct? (8 Replies)
Discussion started by: kristinu
8 Replies
DH_INSTALL(1)							     Debhelper							     DH_INSTALL(1)

NAME
       dh_install - install files into package build directories

SYNOPSIS
       dh_install [-Xitem] [--autodest] [--sourcedir=dir] [debhelperoptions] [file|dir...destdir]

DESCRIPTION
       dh_install is a debhelper program that handles installing files into package build directories. There are many dh_install* commands that
       handle installing specific types of files such as documentation, examples, man pages, and so on, and they should be used when possible as
       they often have extra intelligence for those particular tasks. dh_install, then, is useful for installing everything else, for which no
       particular intelligence is needed. It is a replacement for the old dh_movefiles command.

       This program may be used in one of two ways. If you just have a file or two that the upstream Makefile does not install for you, you can
       run dh_install on them to move them into place. On the other hand, maybe you have a large package that builds multiple binary packages. You
       can use the upstream Makefile to install it all into debian/tmp, and then use dh_install to copy directories and files from there into the
       proper package build directories.

       From debhelper compatibility level 7 on, dh_install will fall back to looking in debian/tmp for files, if it does not find them in the
       current directory (or wherever you've told it to look using --sourcedir).

FILES
       debian/package.install
	   List the files to install into each package and the directory they should be installed to. The format is a set of lines, where each
	   line lists a file or files to install, and at the end of the line tells the directory it should be installed in. The name of the files
	   (or directories) to install should be given relative to the current directory, while the installation directory is given relative to
	   the package build directory. You may use wildcards in the names of the files to install.

	   Note that if you list exactly one filename or wildcard-pattern on a line by itself, with no explicit destination, then dh_install will
	   automatically guess the destination to use, the same as if the --autodest option were used.

       debian/not-installed
	   Used with the deprecated --list-missing and --fail-missing options.	Please refer to dh_missing(1) for the documentation of this file.

OPTIONS
       --list-missing
	   Deprecated: Please use dh_missing --list-missing instead.  If you use this option, dh_install will call dh_missing with that option
	   after it has processed all the files.  Please see dh_missing(1) for the documentation of this option.

	   This option is removed in compat 12.

       --fail-missing
	   Deprecated: Please use dh_missing --fail-missing instead.  If you use this option, dh_install will call dh_missing with that option
	   after it has processed all the files.  Please see dh_missing(1) for the documentation of this option.

	   This option is removed in compat 12.

       --sourcedir=dir
	   Look in the specified directory for files to be installed.

	   Note that this is not the same as the --sourcedirectory option used by the dh_auto_* commands. You rarely need to use this option,
	   since dh_install automatically looks for files in debian/tmp in debhelper compatibility level 7 and above.

       --autodest
	   Guess as the destination directory to install things to. If this is specified, you should not list destination directories in
	   debian/package.install files or on the command line. Instead, dh_install will guess as follows:

	   Strip off debian/tmp (or the sourcedir if one is given) from the front of the filename, if it is present, and install into the dirname
	   of the filename. So if the filename is debian/tmp/usr/bin, then that directory will be copied to debian/package/usr/. If the filename
	   is debian/tmp/etc/passwd, it will be copied to debian/package/etc/.

       file|dir ... destdir
	   Lists files (or directories) to install and where to install them to.  The files will be installed into the first package dh_install
	   acts on.

LIMITATIONS
       dh_install cannot rename files or directories, it can only install them with the names they already have into wherever you want in the
       package build tree.

       However, renaming can be achieved by using dh-exec with compatibility level 9 or later.	An example debian/package.install file using dh-
       exec could look like:

	#!/usr/bin/dh-exec
	debian/default.conf => /etc/my-package/start.conf

       Please remember the following three things:

       o   The package must be using compatibility level 9 or later (see debhelper(7))

       o   The package will need a build-dependency on dh-exec.

       o   The install file must be marked as executable.

SEE ALSO
       debhelper(7)

       This program is a part of debhelper.

AUTHOR
       Joey Hess <joeyh@debian.org>

11.1.6ubuntu2							    2018-05-10							     DH_INSTALL(1)
All times are GMT -4. The time now is 03:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy