Find command giving this output
[root@localhost /]# find var/log/ -iname anaconda.* var/log/anaconda.log var/log/anaconda.xlog var/log/anaconda.yum.log var/log/anaconda.syslog var/log/anaconda.program.log var/log/anaconda.storage.log
After combining with tar it's showing this output
[root@localhost /]# find var/log/ -iname anaconda.* -exec tar -cvf file.tar {} \;
var/log/anaconda.log
var/log/anaconda.xlog
var/log/anaconda.yum.log
var/log/anaconda.syslog
var/log/anaconda.program.log
var/log/anaconda.storage.log
But while listing tar file its showing only single file
[root@localhost /]# tar -tvf file.tar -rw------- root/root 208454 2012-02-27 12:01 var/log/anaconda.storage.log
What I am doing wrong here?
with xargs I am getting output
[root@localhost /]# find var/log/ -iname anaconda.* | xargs tar -cvf file1.tar
2nd doubt
While typing / in front of var, means find /var/log why its giving this mesaage tar: Removing leading `/' from member names
[root@localhost /]# find /var/log/ -iname anaconda.* -exec tar -cvf file.tar {} \;
tar: Removing leading `/' from member names
/var/log/anaconda.log
tar: Removing leading `/' from member names
/var/log/anaconda.xlog
tar: Removing leading `/' from member names
/var/log/anaconda.yum.log
tar: Removing leading `/' from member names
/var/log/anaconda.syslog
tar: Removing leading `/' from member names
/var/log/anaconda.program.log
tar: Removing leading `/' from member names
/var/log/anaconda.storage.log
In simple form what is the difference between in these 2
find var/log and find /var/log
findcommand, you should quote the search term. It works without sometimes but not always. – nerdwaller Dec 1 '12 at 15:39