Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why does this fail "ls -l ¦ rm -i"

Status
Not open for further replies.

Tison

Programmer
May 12, 1999
216
CH
I want to list files (ls -l) and ask if must delete (rm -i) ?
I need this command " ls -l | rm -i"
 
Hi,
You have to use a command like this :
# find /path/to/files -name "pattern*" -ls -exec rm -i {} \;

Caution : This kind of command is to use with care

Hope this helps
 
It doesn't work mainly 'cause "ls -l" produces a long listing with a lot of info file related and human readable but absolutely misidrecting for the "rm -i" command
 
this must be a trick question. try just ls rather than ls -l, or ls -1 if you feel fancy.

IBM Certified -- AIX 4.3 Obfuscation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top