|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
Shell Script to List Directories...
Hello,
I am new to shell scripting. I am running Red Hat using Bash. I am trying to create a little script that will loop through the -sub-directories of the systems home directory, and then recursively zip up the contents of each one saving it as the name of that particularly directory. I cannot figure out how to do this. Can anyone help? Thanks |
|
#2
|
|||
|
|||
|
#!/usr/bin/local/bash
# # cd to the directory you want to backup first. # You could also easily modify the script to take #command line arguments. for user in $( ls . ) do tar czvf /back_up_dir/$user.tar.gz $user done |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > Linux Help > Shell Script to List Directories... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|