Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to List and copy the files containing a string Post 302138032 by redlotus72 on Friday 28th of September 2007 10:04:59 AM
Old 09-28-2007
How to List and copy the files containing a string

Smilie
I have more than 8000 files in a dir, I need to copy to other dir which containing the "sample"

I tried
grep -il "1189609240791-1268115603299237276@216.109.111.119 ' | cp /tmp/inv

Nothing is happening for long time for 100 file dir too,

Any one can help me?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

copy and rename list of files

Hi all, I am a newbie in writng unix..I am using ksh shell..Does anyone know how to copy a list o files from directory A to directory B with differnt names? i.e in Dir A, I have RPT101.555.TXT RPT102.666.TXT and I want to copy those files to dir B with new naming convention.. in Dir B,... (7 Replies)
Discussion started by: kinmak
7 Replies

2. Shell Programming and Scripting

Copy string from files into new file

I'm trying to copy a string (myame@yahoo.com) from multiple files and save them to a new file. This is what's I've gathered so far: sed 's/string/g' file.txt > output.txt Not sure how to run this on multiple files and extract just the email address found in each file. Any help would be... (2 Replies)
Discussion started by: rdell
2 Replies

3. Shell Programming and Scripting

find list of files from a list and copy to a directory

I will be very grateful if someone can help me with bash shell script that does the following: I have a list of filenames: A01_155716 A05_155780 A07_155812 A09_155844 A11_155876 that are kept in different sub directories within my current directory. I want to find these files and copy... (3 Replies)
Discussion started by: manishabh
3 Replies

4. Shell Programming and Scripting

how to copy files followed by list of names of all the files in /etc?

....... (2 Replies)
Discussion started by: pcbuilder
2 Replies

5. Shell Programming and Scripting

copy all files that ls -l list

Hi, I need to copy all files from this statement to another folder: ls –l ./apps | grep –E “^l|^v” How can i do that? best regards! (8 Replies)
Discussion started by: xus
8 Replies

6. Shell Programming and Scripting

Copy list of files from a keyword list to another directory

Hello, I have a folder with a massive amount of files, and I want to copy out a specific subset of the files to a new directory. I would like to use a text file with the filenames listed, but can't get it to work. The thing I'm hung up on is that the folder names in the path can and do have... (5 Replies)
Discussion started by: twjolson
5 Replies

7. Shell Programming and Scripting

Copy files to a dir using from a list

Hi all, I'd very grateful for some help with the following: I have a directory with several subdirectories with files in them. All files are named different, even between different subdirectories. I also have a list with some of those file names in a txt file (without the path, just the file... (5 Replies)
Discussion started by: foracoffee
5 Replies

8. Shell Programming and Scripting

Grep string in files and list file names that contain the string

Hi, I have a list of zipped files. I want to grep for a string in all files and get a list of file names that contain the string. But without unzipping them before that, more like using something like gzcat. My OS is: SunOS test 5.10 Generic_142900-13 sun4u sparc SUNW,SPARC-Enterprise (8 Replies)
Discussion started by: apenkov
8 Replies

9. Shell Programming and Scripting

I'm trying 2 copy files after using the grep to get a list

for XmlFileName in ${xmlFileNames} do XmlFileName=$(echo $XmlFileName | sed 's|./||') # Remove leading ./ path that find command prefixes to filenames cp $XmlFileName $NEW_DIR/ done (1 Reply)
Discussion started by: emc^24sho
1 Replies

10. UNIX for Dummies Questions & Answers

Copy Files From a big list

Requirement: When I do ls -ltr /home/data/orders I get a huge list of files, I need to copy that last 50 to another directory say /home/work/ later, I will do my ETL process and then again I need to copy from 51 to 100 and so on. What is the command to copy files specifying 1 to 50... (5 Replies)
Discussion started by: eskay
5 Replies
UNBURDEN-HOME-DIR(1)						   User Commands					      UNBURDEN-HOME-DIR(1)

NAME
unburden-home-dir - unburdens home directories from caches and trashes SYNOPSIS
unburden-home-dir [ -n | -u | -f filter ] unburden-home-dir ( -h | --help | --version ) DESCRIPTION
unburden-home-dir unburdens the home directory from files and directory which cause high I/O or disk usage but are neither important if they are lost, e.g. caches or trash directory. When being run it moves the files and directories given in the configuration file to a location outside the home directory, e.g. /tmp or /scratch, and puts appropriate symbolic links in the home directory instead. OPTIONS
-f just unburden those directory matched by the given filter (a perl regular expression) -- matches the already unburdened directories if used together with -u. -F Do not check for files in use with lsof before (re)moving files. -n dry run (show what would be done) -u undo (reverse the functionality and put stuff back into the home directory) -h, --help show this help --version show the program's version EXAMPLES
Example configuration files can be found at /usr/share/doc/unburden-home-dir/examples on Debian-based systems and in the etc/ directory of the source tar ball. FILES
/etc/unburden-home-dir, /etc/unburden-home-dir.list, ~/.unburden-home-dir, ~/.unburden-home-dir.list, /etc/default/unburden-home-dir, /etc/X11/Xsession.d/95unburden-home-dir Read /usr/share/doc/unburden-home-dir/README on debianoid installations or README in the source tar ball for an explanation of these files. SEE ALSO
corekeeper (http://openvswitch.org/cgi-bin/gitweb.cgi?p=corekeeper), autotrash(1), agedu(1), bleachbit(1). For du(1)-like but more comfortable tools, see ncdu(1) (text-mode), baobab(1) (GNOME), filelight(1) (KDE), xdiskusage(1) (X tool calling du(1) itself), or xdu(1) (X tool reading du(1) output from STDIN). AUTHOR
Unburden Home Dir is written and maintained by Axel Beckert <beckert@phys.ethz.ch> LICENSE
Unburden Home Dir is available under the terms of the GNU General Public License (GPL) version 2 or any later version at your option. Unburden Home Directory May 2012 UNBURDEN-HOME-DIR(1)
All times are GMT -4. The time now is 08:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy