From: Jerome Robertson on 19 Mar 2010 19:15 I want to execute the File command on every file in /etc/sysconfig and record the output in a file named sysconfig.find Here is what I tried that didn't work: find /etc/sysconfig -exec file {} /home/JR/sysconfig.find \; 2>/dev/null I can't see why this command won't work.
From: SM on 19 Mar 2010 19:33 2010-03-19, Jerome Robertson skribis: > I want to execute the File command on every file in /etc/sysconfig and > record the output in a file named sysconfig.find > > Here is what I tried that didn't work: > > find /etc/sysconfig -exec file {} /home/JR/sysconfig.find \; 2>/dev/null > > I can't see why this command won't work. I usually do it via xargs: find /etc/sysconfig -type f -print0 | xargs -0 file > /home/JR/sysconfig.find -- kasmra :wq
From: Florian Diesch on 19 Mar 2010 20:00 Jerome Robertson <consimgamer(a)earthlink.net> writes: > I want to execute the File command on every file in /etc/sysconfig and > record the output in a file named sysconfig.find > > Here is what I tried that didn't work: > > find /etc/sysconfig -exec file {} /home/JR/sysconfig.find \; 2>/dev/null That doesn't write any output in /home/JR/sysconfig.find but calls file on the found file and /home/JR/sysconfig.find Try find /etc/sysconfig -exec file {} \; > /home/JR/sysconfig.find Florian -- <http://www.florian-diesch.de/software/shell-scripts/>
|
Pages: 1 Prev: hyper terminal Next: Guys, last bit of html cleaning code needed please! |