Oracle Solaris System Administration (MOSC)

MOSC Banner

How to exclude files from tar?

edited Jul 25, 2011 2:31PM in Oracle Solaris System Administration (MOSC) 3 commentsAnswered ✓
Hello,
I've been trying to exclude some hidden files from a tar but without success.
I must be doing something wrong but I couldn't detect the error:
I'd appreciate if you can help.
user1@bw5n003:/tmp $ ll -d test
drwxr-xr-x   3 user1    staff        228 Jul 25 15:24 test

user1@bw5n003:/tmp $ ll -a test
total 48
drwxr-xr-x   3 user1    staff        228 Jul 25 15:24 .
drwxrwxrwt   5 root     sys          464 Jul 25 15:34 ..
drwxr-xr-x   2 user1    staff         69 Jul 25 15:11 .snapshot
-rw-r--r--   1 user1    staff          7 Jul 25 15:11 test1
-rw-r--r--   1 user1    staff         14 Jul 25 15:12 test2
-rw-r--r--   1 user1    staff         13 Jul 25 15:24 test3


user1@bw5n003:/tmp $ cat -et exclude-file
test3
.snapshot


user1@bw5n003:/tmp $ tar cvfX z.tar exclude-file test

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center