delete links along with the files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting delete links along with the files
# 1  
Old 07-01-2009
delete links along with the files

Hi,
I am new to unix
I am removing some unwanted files from the directory by using the following command

find . -name "*" -exec rm -f {} \;

But i want the corresponding links also to be removed
can one help me

Thanks
# 2  
Old 07-01-2009
I explained this in detail here... https://www.unix.com/shell-programmin...ead-links.html
and a good discussion followed...
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script needed to delete to the list of files in a directory based on last created & delete them

Hi My directory structure is as below. dir1, dir2, dir3 I have the list of files to be deleted in the below path as below. /staging/retain_for_2years/Cleanup/log $ ls -lrt total 0 drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2 drwxr-xr-x 2 root ... (2 Replies)
Discussion started by: prasadn
2 Replies

2. UNIX for Advanced & Expert Users

copy original files from links

I have folder ABC and files in ABC are links. I want to create the same ABC folder in different path and copy the actual files from source ABC dir. Can anyone provide HP-UX command for this? note: cp -L is not working in HP-UX Thanks in advance. (1 Reply)
Discussion started by: venkatababu
1 Replies

3. AIX

List all the soft links and hard links

Hi I'm logged in as root in an aix box Which command will list all the soft links and hard links present in the server ? (2 Replies)
Discussion started by: newtoaixos
2 Replies

4. Solaris

Hard Links and Soft or Sym links

When loooking at files in a directory using ls, how can I tell if I have a hard link or soft link? (11 Replies)
Discussion started by: Harleyrci
11 Replies

5. Shell Programming and Scripting

Delete and Recreate around 400 Symbolic Links in one Folder

Hello, I recently just switched my phphandler to suPHP on my server in order to increase security a bit. I am working with 2 scripts, one of which is vbulletin forums and the other is custom. The vbulletin forum avatars are all symbolic links to pictures in the other custom script. When I... (2 Replies)
Discussion started by: ambition13
2 Replies

6. Shell Programming and Scripting

delete dead links

i am writing small shell script how can i find dead links How can delete dead links Thanx (5 Replies)
Discussion started by: KiranKumarKarre
5 Replies

7. Shell Programming and Scripting

copying links/files using rsync command

Hi I am using rsync command to copy the likes like bwlow rsync -vaR krish/harris/test data/charles I am running this script in test1 folder but the krish/harssis /test is existed in test2 folder. So when i run this command am getting the error like rsync: link_stat... (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies

8. UNIX for Dummies Questions & Answers

One-time use files/links

Im in the process of developing a content based website in which people will be able to upload movies(which are then converted to flv format and displayed in a flash based player.) In order to protect the submitted content I would like to setup an offsite folder for the videos and create... (0 Replies)
Discussion started by: Airhead315
0 Replies
Login or Register to Ask a Question