Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Copy directory withOUT recursion Post 303020679 by chebarbudo on Wednesday 25th of July 2018 11:10:35 AM
Old 07-25-2018
Didn't know the command pax.
I had to install the package pax.
It does exactly what I want.
Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Recursion to Copy a Directory structure

I have the below code to recurse through a given file path. I am able to go to the leaf level once recursively but traversing out is not possible as the required varaibles don't have the values on return. Both typeset and local don't work for my variable definitions. I have the o/p of the sample... (2 Replies)
Discussion started by: avrkiran
2 Replies

2. SuSE

cant copy from one directory to another

I faced a problem when I tried to copy files from one directory to another using certain user although this user has r/w/x permission on source and destination directory ?? the OS is Linux-Suse 9 any help?? (2 Replies)
Discussion started by: mm00123
2 Replies

3. Shell Programming and Scripting

Help with directory copy please

Hi, I have a folder that has about 100 directories. They all have different names. I need to do a find and copy of only directories (and their files) that start with ABC. There are directory names as ABCDE,ABCDG,ABCHT and so on. I tried using the AB* but that doesn't work. Can someone... (4 Replies)
Discussion started by: bbbngowc
4 Replies

4. Shell Programming and Scripting

Copy Last modified directory to another directory

Hi, I have to copy last modified Directory to another directory.How can i Do using pipe or redirect cp -R 'ls -lrt|tail -1' test is not working. please help. (3 Replies)
Discussion started by: shaveta
3 Replies

5. UNIX for Dummies Questions & Answers

How to copy all files into the same directory

Dear All, Again I have another simple question. :confused: I want to write a csh which can copy all files of a current directory with a new name in the same directory, I mean: If I have tree bird apple as files in a directory I want to give ,say number 007 as argument to my csh and it copies... (3 Replies)
Discussion started by: dreamer0085
3 Replies

6. UNIX for Dummies Questions & Answers

Copy everything in a directory

I use (cp new folder directory), but it just makes a new folder, i want to copy everything in a directory not the actual directory. (10 Replies)
Discussion started by: wiinick
10 Replies

7. Shell Programming and Scripting

how to copy the directory but not copy certain file

Hi experts cp bin root src /mnt but not copy bin/bigfile any help? ( I post this thread in the "redhat" forum wrongly, I don't know how to withdraw that question in that wrong forum) Thanks (6 Replies)
Discussion started by: yanglei_fage
6 Replies

8. Shell Programming and Scripting

Copy the files in directory and sub folders as it is to another directory.

How to copy files from one directory to another directory with the subfolders copied. If i have folder1/sub1/sub2/* it needs to copy files to folder2/sub1/sub2/*. I do not want to create sub folders in folder2. Can copy command create them automatically? I tried cp -a and cp -R but did... (4 Replies)
Discussion started by: santosh2626
4 Replies

9. Shell Programming and Scripting

Copy directory without using cp-r

Hi guys, I need a solution to copy files and folders without using cp-r , cp-R or any variants. So i need to code it manually. I allready have a loop #!bin/bash IFS=$'\n' if test "$1" = "" then wd=pwd else wd=$1 fi for file in $(find $1) do if... (1 Reply)
Discussion started by: Wolverine89
1 Replies

10. Shell Programming and Scripting

Directory Tree/Recursion Issue . . .

Hope the title is close enough; didn't quite know how to put this... OK. We have a hypothetical script, script.a, with one simplistic line:bash ./nextDir/script.bNow script.b has a bit more going for it; and does file moves, copies, and renames, calling all the targets with respect to itself.... (7 Replies)
Discussion started by: LinQ
7 Replies
tar(4)							     Kernel Interfaces Manual							    tar(4)

NAME
tar, pax - Archive file format DESCRIPTION
The cpio, pax, and tar commands dump several files into one, in a medium suitable for transportation. This file is often referred to as a tar file, or tar tape, since it was originally designed to be on an archive tape. An archive file is a series of blocks, with each block of size TBLOCK. A file on the archive is represented by a header block which describes the file, followed by zero or more blocks which give the contents of the file. At the end of the tape are two blocks filled with binary zeros, as an end-of-file indicator. The blocks are grouped for physical I/O operations. Each group of n blocks (where n is set by the b keyletter on the tar command line, with a default of 20 blocks) is written with a single system call. On nine-track tapes, the result of this write is a single tape record. The last group is always written at the full size, so blocks after the two zero blocks contain random data. On reading, the specified or default group size is used for the first read, but if that read returns less than a full tape block, the reduced block size is used for further reads. The header block looks like: ------------------------------------- Field Name Offset Length ------------------------------------- name 0 100 mode 100 8 uid 108 8 gid 116 8 size 124 12 mtime 136 12 chksum 148 8 typeflag 156 1 linkname 157 100 magic 257 6 version 263 2 uname 265 32 gname 297 32 devmajor 329 8 devminor 337 8 prefix 345 155 ------------------------------------- The name field is the name of the file, as specified on the command line. Files dumped because they were in a directory that was named on the command line have the directory name as prefix and /filename as suffix. The mode field is the file mode, with the top bit masked off. The uid and gid fields are the user id and group id numbers that own the file. The size field is the size of the file in bytes. Links and symbolic links are dumped with this field specified as zero. The mtime field is the modification time of the file at the time it was dumped. The chksum field is an octal ASCII value which represents the sum of all the bytes in the header block. When calculating the checksum, the chksum field is treated as if it were all blanks. The typeflag field identifies the type of data following the header. Valid values are: A Global Extended Header follows. An Extended Header follows. Archive data follows. The Global Extended Header and Extended Header formats are only produced when the tar command is used with the -E option, or the pax com- mand is used with the -x xtar option. The linkname field is the name of the file that this file is linked to, if any. If this field is empty, the file is not linked. The first time a given i-node number is dumped, it is dumped as a regular file. Subsequently, it is dumped as a link instead. Upon retrieval, if a link entry is retrieved but the file it was linked to is not, an error message is printed and the tape must be rescanned manually to retrieve the file that it is linked to. The magic field is the magic number for the file type as described in the magic(4) reference page. The version field is always 00 (zero-zero). The uname and gname fields are the user name and group names that own the file. The devmajor and devminor fields are the device major and minor numbers as described in the mknod(8) reference page. The name, linkname, and prefix fields are null-terminated strings, except when all characters in the field are non-null characters. The typeflag field is a single character. The other fields are zero-filled octal numbers in ASCII format terminated by a null character. Unused fields of the header are binary zeros (and are included in the checksum). NOTES
The encoding of the header is designed to be portable across platforms. If filenames are chosen that use characters not in the portable filename character set, results are unpredictable. EXAMPLES
The layout of an archive with a Global Extended Header, two data files, and the end of archive is shown here. ----------------------------------- ustar Header (typeflag=g) Global Extended Header Data ----------------------------------- ustar Header (typeflag=x) Extended Header Data ustar Header (typeflag=0) Data for File 1 ----------------------------------- ustar Header (typeflag=0) Data for File 2 ----------------------------------- ustar Header (typeflag=0) Data for File n ----------------------------------- Block of binary zeroes ----------------------------------- Block of binary zeroes ----------------------------------- RELATED INFORMATION
Commands: cpio(1), mknod(8), pax(1), tar(1) Files: magic(4) delim off tar(4)
All times are GMT -4. The time now is 02:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy