LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 06-22-2002, 09:45 AM   #1
ForumKid
Member
 
Registered: Dec 2001
Posts: 195

Rep: Reputation: 30
Script on linux to delete certain files


HI,
I think this may have to be done in C, but no clue. I figured you all out there have done this and may possibly be able to give me a script.

I have a bunch of pictures. Lets say all in /home/pictures. In this directory there are pics such as 1.jpg, 2.jpg, 5.jpg, 103.jpg. A bunch of them. I want to write a script where I can fill in the name of the pictures (like have a file with all the pics that i want to delete) and then run the script to delete them instead of manually deleting pictures.

My ultimate goal is to run a script to read an oracle db and based on whether the pic is found in the db, i will know if i should delete the picture.

MAybe someone can give me a hint on how to accomplish this. I dont necessarily need someone to code it for me, i can prob figure it out, jsut need the logic.
Thanks
 
Old 06-22-2002, 10:31 AM   #2
zLinuxz
Senior Member
 
Registered: Feb 2002
Location: Shanghai, CHINA
Distribution: RH 5.0,5.1 6.0,6.1 7.0,7.1,7.2,7.3.,8.0,9.0, RH Enterprise, Fedora C1, C2
Posts: 1,216

Rep: Reputation: 45
heh, like how many pictures?
 
Old 06-22-2002, 02:09 PM   #3
Druaga
Member
 
Registered: May 2002
Location: Canada
Distribution: Slackware
Posts: 111

Rep: Reputation: 15
couldnt you put the names of the pics in a plain text .dat file (each name on a separate line) then do
rm-f | cat pics.dat
(i have no clue if this woukd work... I doubt it will)

Last edited by Druaga; 06-22-2002 at 02:11 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script to delete files with 0k file size in a directory justgiver Linux - Newbie 4 01-28-2008 05:56 AM
need a script to delete all files from a folder and subfolders cccc Programming 1 03-04-2005 11:54 AM
bash script to delete files c0d3 Programming 9 12-05-2004 11:45 PM
Delete old files and folders Script? AsteX Linux - General 4 11-11-2004 07:26 PM
Why does this script just delete my new wav files all the time? kleptophobiac Linux - Software 5 01-15-2004 10:06 PM


All times are GMT -5. The time now is 05:32 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration