Removing invisible files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Removing invisible files
# 1  
Old 04-12-2010
Removing invisible files

hi
I have lots of invisable files under a file structure which i would like to delete from the top level rather than going down into each folder.
All the files start with ._ these are stub files that get generated. Does anyone have a script that will do this please
thanks
Treds

Last edited by pludi; 04-12-2010 at 09:40 AM.. Reason: removed code tags
# 2  
Old 04-12-2010
rm -R

Quote:
Originally Posted by treds
hi
I have lots of invisable files under a file structure which i would like to delete from the top level rather than going down into each folder.
All the files start with ._ these are stub files that get generated. Does anyone have a script that will do this please
thanks
Treds
Hello,

rm -R .......... will work.

or a script with find / -name "YOURFILEPATTERN" -exec rm -f {} \;


But be careful !!!!!!

Regards

Last edited by bdittmar; 04-12-2010 at 10:12 AM.. Reason: correction
# 3  
Old 04-12-2010
hello Treds,

make use of this code ,this may help you.

Code:
rm -r ._*


Regards,
Sanjay
# 4  
Old 04-12-2010
invisable files

Code:
Hi
i am trying to delete invisiable files from within a file structure without have to go done into each folder which is variable multiple levels deep.
All files start with ._
was wondering if any ones got a script that will do this
regards
Treds

# 5  
Old 04-12-2010
find /<your>/<path> -type f -name .\_\* -exec rm -f {} \;

Be careful with path you are using.

Enjoy!

Regards,
-Artur.

Last edited by Artur Zaworski; 04-12-2010 at 12:17 PM..
# 6  
Old 04-12-2010
files

Code:
hi both dont work i am affraid
here is a view of files
-rwxrw-rw-   1 root root   4348 Feb  5 14:43 ._VAL BARB 20x112 OFFER_Layout 2.pdf
-rwxrw-rw-   1 root root     82 Mar  1 17:20 ._Winnersh_Homeown.pdf
-rwxrw-rw-   1 root root  61160 Dec  4 23:13 ._WRAPPING.pdf
here is the exact path

[root@TAG-468 ISOnewspaper26v4]# pwd
/appcfg/Admin_Backup_Files/Proofing_Folders/HOT_FOLDERS_1ST_FLOOR/INPUT_HOT/COLORBUS_1/ISOnewspaper26v4

this is the command i ran
find /appcfg/Admin_Backup_Files/Proofing_Folders/ -name "._" -exec rm -f {} \;

# 7  
Old 04-12-2010
Enhanced the find and made it easier to deal with filenames containins spaces and easier to test.

Code:
find /appcfg/Admin_Backup_Files/Proofing_Folders/ -type f -name \.\_\* -print|while read filename
do
        # Replace echo with rm when sure
        echo "${filename}"
done

 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

To remove any invisible and special characters from the file(exclude @#!$*)

Hi Guys, My requirement is to remove any invisible and special characters from the file like control M(carriage return) and alt numerics and it should not replace @#!$% abc|xyz|acd¥£ó adc|123| 12áí Please help on this. Thanks Rakesh (1 Reply)
Discussion started by: rakeshp
1 Replies

2. UNIX for Beginners Questions & Answers

Find and removing the old files and zipping the files using shell script

Hi, I am trying to removing the old files which were older than 10 days and same g zipping the files using the shell script. script was return as follows. find /jboss7_homes/JBOSS7/SKYLIV??/SKYLIV??_CRM/jboss-eap-7.0/standalone/log -mtime +10 -type f | xargs rm -f find /cer_skyliv??/log... (6 Replies)
Discussion started by: venkat918
6 Replies

3. Shell Programming and Scripting

To make password/input text invisible?

All, My script is ----------- #cat pass.sh password=123 echo -n "Enter pass:" read pass if ; then echo "Correct password" else echo "Wrong password" fi When i run this script, text(password) which i'm entering is visible in screen... (4 Replies)
Discussion started by: thomasraj87
4 Replies

4. Shell Programming and Scripting

Handling Invisible character in a file

Hi Experts, When i am trying to read a csv file ,i could find some invisible character in it. I tried to see those characters by following code od -c filename It is displaying 240 for those invisible character. can some one elobrate on this and provide solution remove those character from... (4 Replies)
Discussion started by: cnraja
4 Replies

5. Virtualization and Cloud Computing

Invisible/Transparent Background in VM

Hello, If you switch to "seamless mode" in virtualbox, you can see the taskbar of the OS on your screen , like having a transparent background on your VM. My question: is there a possibility to do the same in VMware's Workstation (7) ? I know and use the "Unity" mode in Workstation/Player, but... (0 Replies)
Discussion started by: al0x
0 Replies

6. UNIX for Advanced & Expert Users

Directory is invisible in listing but it is exist.

Hi ALL. Can anyone could help me. Have you had a chance to experienced that when you list (ls) a directory from ordinary execution of command, you couldn't see the directory. However, when you list it from the directory filename itself or even changing to directory (cd), it will show to you... (9 Replies)
Discussion started by: BCJapan
9 Replies

7. Shell Programming and Scripting

Problem with alias and invisible text

okay how do i make an alias that has a space in it? for most of my other ones i've simply done within my ~/.bash_profile alias `ls`='ls -laF' but with alias `sudo su`='sh hello.sh' I'm unable to make it work in addition i was wondering how i could allow the user to type in... (1 Reply)
Discussion started by: cleansing_flame
1 Replies

8. UNIX for Advanced & Expert Users

Invisible login

Hello! My 1st post here, and I am not so sure if it belongs to the "Andvanced" category! I have searched very much to find a way to login to a system in such a way, that others will not be able to "see" me, with the "who" command! So, is there anybody here to help me with this? :rolleyes: ... (1 Reply)
Discussion started by: SmileKilled
1 Replies

9. UNIX for Dummies Questions & Answers

Identifying invisible characters in Unix file

I have a file, which when you look at it, appears as if it has spaces.... But sometimes, it is has tab or Nulls or some other character which we are not able to see..... How to find what character exactly it is in the file, where ever we are seeing a space... (Iam in solaris)... (1 Reply)
Discussion started by: thanuman
1 Replies
Login or Register to Ask a Question