Sponsored Content
Top Forums Shell Programming and Scripting Help with using grep command with copy command Post 302495547 by yinyuemi on Thursday 10th of February 2011 02:18:17 PM
Old 02-10-2011
Code:
cd /home/david/lab3
for i in ls *.save
do
cp $i /home/user113/lab3
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

copy command

what command would i wrote to copy files from $folder1 to $folder2 ???? (1 Reply)
Discussion started by: perleo
1 Replies

2. Linux

copy command

sir can any body tell me how i can copy files like copy c:\abc\pqr\mr.txt c:\windows\my documents\this.txt i need command in linux like this really i am a new in linux that is why simple questions alson can any body explain me how i get current directory tree or path in windows... (2 Replies)
Discussion started by: sadiquep
2 Replies

3. Shell Programming and Scripting

Need help in Copy Command

i need to copy some files from a directory and move the copy files to some destination with the extension .dat Can any one help on this (5 Replies)
Discussion started by: ranga27
5 Replies

4. UNIX for Dummies Questions & Answers

Copy a command string from the command line

How can we copy a command string from a previous command line and paste it into the cursor position on the current command line? I know that ^c will not work as the shell will interpret as an interrupt signal. Thanks, (1 Reply)
Discussion started by: Pouchie1
1 Replies

5. Shell Programming and Scripting

can anyone help with shell script command about searching word with grep command?

i want to search in the current directory all the files that contain one word for example "hello" i want to achieve it with the grep command but not with the grep * (2 Replies)
Discussion started by: aintour
2 Replies

6. Shell Programming and Scripting

grep date with copy command

how can i copy only those files with creation date less then 24 hours. (1 Reply)
Discussion started by: Danish Shakil
1 Replies

7. Shell Programming and Scripting

Help with copy command

Hello, I have a directory in which I have files as follows CRDT.csv CRDT.csv.1 CRDT.csv.2 .... CRDT.csv.n I would like to copy it over to another directory as crdt_lon.csv crdt_lon.csv.1 crdt_lon.csv.2 .... crdt_lon.csv.n I am looking for a one line command but I am... (5 Replies)
Discussion started by: srattani
5 Replies

8. Shell Programming and Scripting

Copy command does not work

I am new to this forum. I have a script which randomly throws error.Following are steps followed in this script: Generate Term file Remove previous term and rpt files from utility directory. copy term file to utility directory call sql to generate rpt file using term file as input copy the... (4 Replies)
Discussion started by: ann15
4 Replies

9. Shell Programming and Scripting

Grep command giving different result for different users for same command

Hello, I am running below command as root user #nodetool cfstats tests | grep "Memtable switch count" Memtable switch count: 12 Where as when I try to run same command as another user it gives different result. #su -l zabbix -s /bin/bash -c "nodetool cfstats tests | grep "Memtable switch... (10 Replies)
Discussion started by: Pushpraj
10 Replies

10. UNIX for Dummies Questions & Answers

Copy command

Hi , I am trying to take a backup of file before overwriting it with cp command, I am using the command cp -b. -rw-rw-r-- 1 autoengine murex 0 Jan 22 07:08 a -rw-rw-r-- 1 autoengine murex 0 Jan 22 07:08 b cp -b a b -rw-rw-r-- 1 autoengine murex 0 Jan 22 07:08 a -rw-rw-r-- 1... (1 Reply)
Discussion started by: Raj999
1 Replies
GIT-CHECKOUT-INDEX(1)						    Git Manual						     GIT-CHECKOUT-INDEX(1)

NAME
git-checkout-index - Copy files from the index to the working tree SYNOPSIS
git checkout-index [-u] [-q] [-a] [-f] [-n] [--prefix=<string>] [--stage=<number>|all] [--temp] [-z] [--stdin] [--] [<file>...] DESCRIPTION
Will copy all files listed from the index to the working directory (not overwriting existing files). OPTIONS
-u, --index update stat information for the checked out entries in the index file. -q, --quiet be quiet if files exist or are not in the index -f, --force forces overwrite of existing files -a, --all checks out all files in the index. Cannot be used together with explicit filenames. -n, --no-create Don't checkout new files, only refresh files already checked out. --prefix=<string> When creating files, prepend <string> (usually a directory including a trailing /) --stage=<number>|all Instead of checking out unmerged entries, copy out the files from named stage. <number> must be between 1 and 3. Note: --stage=all automatically implies --temp. --temp Instead of copying the files to the working directory write the content to temporary files. The temporary name associations will be written to stdout. --stdin Instead of taking list of paths from the command line, read list of paths from the standard input. Paths are separated by LF (i.e. one path per line) by default. -z Only meaningful with --stdin; paths are separated with NUL character instead of LF. -- Do not interpret any more arguments as options. The order of the flags used to matter, but not anymore. Just doing git checkout-index does nothing. You probably meant git checkout-index -a. And if you want to force it, you want git checkout-index -f -a. Intuitiveness is not the goal here. Repeatability is. The reason for the "no arguments means no work" behavior is that from scripts you are supposed to be able to do: $ find . -name '*.h' -print0 | xargs -0 git checkout-index -f -- which will force all existing *.h files to be replaced with their cached copies. If an empty command line implied "all", then this would force-refresh everything in the index, which was not the point. But since git checkout-index accepts --stdin it would be faster to use: $ find . -name '*.h' -print0 | git checkout-index -f -z --stdin The -- is just a good idea when you know the rest will be filenames; it will prevent problems with a filename of, for example, -a. Using -- is probably a good policy in scripts. USING --TEMP OR --STAGE=ALL When --temp is used (or implied by --stage=all) git checkout-index will create a temporary file for each index entry being checked out. The index will not be updated with stat information. These options can be useful if the caller needs all stages of all unmerged entries so that the unmerged files can be processed by an external merge tool. A listing will be written to stdout providing the association of temporary file names to tracked path names. The listing format has two variations: 1. tempname TAB path RS The first format is what gets used when --stage is omitted or is not --stage=all. The field tempname is the temporary file name holding the file content and path is the tracked path name in the index. Only the requested entries are output. 2. stage1temp SP stage2temp SP stage3tmp TAB path RS The second format is what gets used when --stage=all. The three stage temporary fields (stage1temp, stage2temp, stage3temp) list the name of the temporary file if there is a stage entry in the index or . if there is no stage entry. Paths which only have a stage 0 entry will always be omitted from the output. In both formats RS (the record separator) is newline by default but will be the null byte if -z was passed on the command line. The temporary file names are always safe strings; they will never contain directory separators or whitespace characters. The path field is always relative to the current directory and the temporary file names are always relative to the top level directory. If the object being copied out to a temporary file is a symbolic link the content of the link will be written to a normal file. It is up to the end-user or the Porcelain to make use of this information. EXAMPLES
To update and refresh only the files already checked out $ git checkout-index -n -f -a && git update-index --ignore-missing --refresh Using git checkout-index to "export an entire tree" The prefix ability basically makes it trivial to use git checkout-index as an "export as tree" function. Just read the desired tree into the index, and do: $ git checkout-index --prefix=git-export-dir/ -a git checkout-index will "export" the index into the specified directory. The final "/" is important. The exported name is literally just prefixed with the specified string. Contrast this with the following example. Export files with a prefix $ git checkout-index --prefix=.merged- Makefile This will check out the currently cached copy of Makefile into the file .merged-Makefile. GIT
Part of the git(1) suite Git 1.7.10.4 11/24/2012 GIT-CHECKOUT-INDEX(1)
All times are GMT -4. The time now is 12:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy