Pack current folder

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Pack current folder
# 1  
Old 12-14-2007
Pack current folder

How do I pack (using tar zcvf ?) the current folder inluding all files and folders ??

I need to be sure to get all files and folders/subfolders...

Later I will unpack into a new folder on a new server..

Appreciate any help..
# 2  
Old 12-14-2007

This should sort you out

tar cvzf Yourfolder.tar.gz /home/YourFolderName

that should create a tarball of YourFolderName and all sub dirs and save it as Yourfolder.tar.gz
# 3  
Old 12-14-2007

But that looks like it will use the YourFolderName when I unpack it... right ?

This is what I have tried:
tar zcvf filename.tar.gz /httpdocs
Problem is the new server has public_html instead of httpdocs
which gives me public_html/httpdocs

I'd like to do this:
cd /home/YourFolderName
tar zcvf filename.tar.gz *.*/*.*
or similar... I want all files in current folder and all subfolders....

must be simple but I'm not there yet...

anyone ?
# 4  
Old 12-17-2007

So in which case.. tar the folders using the method outline before.

Unpack it into the dir. If it puts them in the incorrect directory just do a cp *.* and move them to the folder you want to use instead. This is a lot easier if you have a GUI to boot into!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to ? same alias should respond differently based on current folder

Hi, I have to handle multiple projects at same time. And i have to go to a folder often in each project. So I have a alias to there. Lets say i am in project environment "sky" (pwd = /home/sky/sim/bla/). For this project i have stored the scripts in the folder lets say... (3 Replies)
Discussion started by: microsim
3 Replies

2. Shell Programming and Scripting

WHM Crontab and Folder Renaming to current date

Hello, i am trying to rename a folder named 'cpbackup' to current date in our WHM Root via setting up a cronetab entry. but the folder does not get renamed on the scheduled time :confused: */1 * * * * timestamp=$(date +%m%d%Y);/bin/mv /ac_backups/cpbackup /ac_backups/$timestamp (4 Replies)
Discussion started by: kandyjet
4 Replies

3. Emergency UNIX and Linux Support

List matching directories in current folder only on AIX

Hi, I need to find the list of matching direcories in current folder only and no subfolders on AIX.I tried -maxdepth option but its not working. Also, tried ls -d option to list the matching directories but getting argument list too long... So, any help would be appreciated. (6 Replies)
Discussion started by: sachinkl
6 Replies

4. UNIX for Dummies Questions & Answers

tar file from current folder

Hello guys, I am sure this has been asked before, but honestly, I cant find post talking about it. Here is what I need: - A tar file will be generated manually by user - This tar file is then used within a bash shell script My source folder structure is like this: ... (2 Replies)
Discussion started by: manolain
2 Replies

5. UNIX for Dummies Questions & Answers

Search current folder and subfolders with grep

Hello, Neither ‘Grep -r' nor ‘grep -R' is working in my environment. (Searching for a text pattern in the files) Any suggestions... Using SunOS 5.9 Thanks, Trinanjan. (1 Reply)
Discussion started by: bhanja_trinanja
1 Replies

6. Shell Programming and Scripting

Getting current folder name appended to all desired files

Hello everyone, Just registered here, I'm kinda new to Unix :o I've been trying to automate some processes with various Windows tools. I found that using unix scripts the result would be closest to my needs. So I installed Cygwin on Windows 7. My folders and files are structured like this:... (7 Replies)
Discussion started by: c_bg1
7 Replies

7. UNIX for Dummies Questions & Answers

Zip recursive content of folder when (not current directory=

Hi, Is there a way to zip the content (recursively) of a folder other then the current directory, and keep the directory structure intact? Example: /var/tmp/myfolder ----------------- file1 ----------------- file2 ----------------- folder1 ------------------------ file3 Now I want... (3 Replies)
Discussion started by: jimih
3 Replies

8. Shell Programming and Scripting

How to find files in current folder only?

How do I find files in current folder only? We are on AIX 5.3, so maxdepth is not supported. I tried to do this find /dir1/dir2/dir3/dir4 -prune -type f to display all files in /dir1/dir2/dir3/dir4 only but it does not show any files. Somehow the -prune option works for dir3 level... (7 Replies)
Discussion started by: Hangman2
7 Replies

9. Windows & DOS: Issues & Discussions

Checking Current Service Pack & Hot Fixes of XP

Dear Sir / Madam, With due respect, I am putting forwarad a question that whenever I am trying to check the current Service Pack & Hotfixes in Windows XP, I am getting the response like as under: (Windows can't find the" qfecheck.exe " check it again) in GUI mode ... (1 Reply)
Discussion started by: swapan
1 Replies

10. Shell Programming and Scripting

Use awk to create new folder in current directory

Alright, I am sure this is a laughable question, but I don't know so I am going to ask anyway. I have a little script I am writing to take information from one source, recode it in a certain way, and print to files for each subject I have data for. This all works perfectly. I just want to put... (6 Replies)
Discussion started by: ccox85
6 Replies
Login or Register to Ask a Question