Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
07-24-2025, 08:03 AM
|
#1
|
|
Member
Registered: Jul 2019
Location: China
Distribution: UnionTech OS Desktop Home (64-bit)
Posts: 259
Rep: 
|
Windows Registry files cannot be deleted from Trash.
On a Chinese forum, a member has failed to delete the following files from Trash.
Code:
user@user-PC:~$ ls ~/.l*/s*/T*/f*/|while IFS= read -r X;do echo "${X}";done
HKEY_CURRENT_USER\Software\kingsoft\Office\6.0\plugins\kcopilotentrylite\aibrandcfg
HKEY_CURRENT_USERSoftwarekingsoftOffice6.0pluginskcopilotentryliteaibrandcfg
The files were created in the Home folder when WPS Office was opened.
He/she used the command " rm" but to no avail.
Code:
user@user-PC:~$ cd ~/.local/share/Trash/files
user@user-PC:~/.local/share/Trash/files$
user@user-PC:~/.local/share/Trash/files$ file="HKEY_CURRENT_USER\Software\kingsoft\Office\6.0\plugins\kcopilotentrylite\aibrandcfg"
user@user-PC:~/.local/share/Trash/files$
user@user-PC:~/.local/share/Trash/files$ rm -rf "${file}"
How can the files be deleted?
Source: https://bbs.chinauos.com/post/22783
|
|
|
|
07-24-2025, 08:36 AM
|
#2
|
|
LQ Guru
Registered: Oct 2004
Distribution: Arch
Posts: 5,818
|
Code:
file="HKEY_CURRENT_USER\Software\kingsoft\Office\6.0\plugins\kcopilotentrylite\aibrandcfg"
rm -rf "${file}"
That isn't a file. It is a partial directory path. Or do you actually have a file named that? If so \ is not allowed in file names. You'll need to escape all of them.
\ is an escape char.
Quote:
|
How can the files be deleted?
|
File or files?
You can delete everything in a directory
Code:
~/.local/share/Trash/files/
~/.local/share/Trash/
|
|
|
1 members found this post helpful.
|
07-24-2025, 09:13 AM
|
#3
|
|
Senior Member
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux, illumos, Minix3
Posts: 1,524
|
The problem comes from the while loop and the way the files are display from the while loop and not from rm itself. You can delete them by hand with rm when the one with backslashes is single quoted or remove everything prefixed with HKEY (or just delete all files in trash). I'm assuming bash as your shell.
Code:
[09:58] jayjwa@atr2:~/.local/share/Trash/files$ touch 'HKEY_CURRENT_USER\Software\kingsoft\Office\6.0\plugins\kcopilotentrylite\aibrandcfg'
[09:59] jayjwa@atr2:~/.local/share/Trash/files$ touch 'HKEY_CURRENT_USERSoftwarekingsoftOffice6.0pluginskcopilotentryliteaibrandcfg'
[09:59] jayjwa@atr2:~/.local/share/Trash/files$ ls -l
total 0
-rw------- 1 jayjwa users 0 Jul 24 09:59 'HKEY_CURRENT_USER\Software\kingsoft\Office\6.0\plugins\kcopilotentrylite\aibrandcfg'
-rw------- 1 jayjwa users 0 Jul 24 09:59 HKEY_CURRENT_USERSoftwarekingsoftOffice6.0pluginskcopilotentryliteaibrandcfg
[09:59] jayjwa@atr2:~/.local/share/Trash/files$ rm -f ~/.local/share/Trash/files/HKEY_*
[09:59] jayjwa@atr2:~/.local/share/Trash/files$ ls -l
total 0
[09:59] jayjwa@atr2:~/.local/share/Trash/files$
You can also use find.
Code:
[10:07] jayjwa@atr2:~/.local/share/Trash/files$ touch 'HKEY_CURRENT_USER\Software\kingsoft\Office\6.0\plugins\kcopilotentrylite\aibrandcfg'
[10:07] jayjwa@atr2:~/.local/share/Trash/files$ touch 'HKEY_CURRENT_USERSoftwarekingsoftOffice6.0pluginskcopilotentryliteaibrandcfg'
[10:08] jayjwa@atr2:~/.local/share/Trash/files$ ls -l
total 0
-rw------- 1 jayjwa users 0 Jul 24 10:07 'HKEY_CURRENT_USER\Software\kingsoft\Office\6.0\plugins\kcopilotentrylite\aibrandcfg'
-rw------- 1 jayjwa users 0 Jul 24 10:07 HKEY_CURRENT_USERSoftwarekingsoftOffice6.0pluginskcopilotentryliteaibrandcfg
[10:08] jayjwa@atr2:~/.local/share/Trash/files$ find ~/.local/share/Trash/files -name '*' -type f -delete
[10:08] jayjwa@atr2:~/.local/share/Trash/files$ ls -l
total 0
|
|
|
|
07-24-2025, 09:52 AM
|
#4
|
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 28,359
|
Quote:
Originally Posted by teckk
Code:
file="HKEY_CURRENT_USER\Software\kingsoft\Office\6.0\plugins\kcopilotentrylite\aibrandcfg"
rm -rf "${file}"
That isn't a file. It is a partial directory path. Or do you actually have a file named that? If so \ is not allowed in file names. You'll need to escape all of them. \ is an escape char.
Quote:
|
=How can the files be deleted?
|
File or files? You can delete everything in a directory
Code:
~/.local/share/Trash/files/
~/.local/share/Trash/
|
Agree with this method...why do anything more than what's needed, especially to delete files already in a 'trash' folder? "rm -fr *" should work fine within the Trash folder. Any folder beneath it will just get recreated when new files get deleted.
|
|
|
|
07-25-2025, 02:14 AM
|
#5
|
|
Member
Registered: Jul 2019
Location: China
Distribution: UnionTech OS Desktop Home (64-bit)
Posts: 259
Original Poster
Rep: 
|
Thanks to all of you!
I have just asked him/her to run the following command:
Code:
rm -rf ~/.local/share/Trash/files/*
Reference: https://bbs.chinauos.com/post/22783?postId=108626
|
|
|
|
07-25-2025, 02:24 AM
|
#6
|
|
Member
Registered: Jul 2019
Location: China
Distribution: UnionTech OS Desktop Home (64-bit)
Posts: 259
Original Poster
Rep: 
|
Quote:
Originally Posted by teckk
do you actually have a file named that?
|
He or she posted the following screenshot:
https://lh3.googleusercontent.com/pw...2-h304-s-no-gm
|
|
|
|
07-25-2025, 02:38 AM
|
#7
|
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 26,460
|
I don't know what is that on the picture, but I guess rm HKEY_* should work.
|
|
|
|
07-25-2025, 02:39 AM
|
#8
|
|
Member
Registered: Jul 2019
Location: China
Distribution: UnionTech OS Desktop Home (64-bit)
Posts: 259
Original Poster
Rep: 
|
Quote:
Originally Posted by TB0ne
"rm -fr *" should work fine within the Trash folder.
|
I think "rm -fr *" will delete files from the Home folder.
|
|
|
|
07-25-2025, 02:43 AM
|
#9
|
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 26,460
|
obviously cd to that dir first
|
|
|
|
07-25-2025, 02:48 AM
|
#10
|
|
Member
Registered: Jul 2019
Location: China
Distribution: UnionTech OS Desktop Home (64-bit)
Posts: 259
Original Poster
Rep: 
|
Quote:
Originally Posted by pan64
obviously cd to that dir first
|
Obviously, a beginner might run a command without thinking about "cd".
|
|
|
|
07-25-2025, 02:50 AM
|
#11
|
|
Member
Registered: Jul 2019
Location: China
Distribution: UnionTech OS Desktop Home (64-bit)
Posts: 259
Original Poster
Rep: 
|
Quote:
Originally Posted by jayjwa
rm -f ~/.local/share/Trash/files/HKEY_*
|
I will ask him or her to run your command in case the command in my post #5 fails.
|
|
|
|
07-25-2025, 02:57 AM
|
#12
|
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 26,460
|
Quote:
Originally Posted by Matthew Wai
I will ask him or her to run your command in case the command in my post #5 fails.
|
That is identical. Anyway, I think you can help him/her to delete those files without LQ, but if you need further help you need to ask for and give us more info, more details.
|
|
|
1 members found this post helpful.
|
07-25-2025, 08:31 AM
|
#13
|
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 28,359
|
Quote:
Originally Posted by Matthew Wai
Obviously, a beginner might run a command without thinking about "cd".
|
Obviously, you would tell the 'he or she' to do so before passing on that command, right??? And if you read what I posted, I said specifically to run it **WITHIN** the Trash folder. That would remove any files and directories...and as said before they will be re-created the next time a file is deleted.
And is there a reason your 'friend' can't post their own questions???
Last edited by TB0ne; 07-25-2025 at 08:48 AM.
|
|
|
|
07-25-2025, 12:58 PM
|
#14
|
|
Member
Registered: Jun 2013
Location: Ferndale, MI USA
Distribution: Debian, NetBSD
Posts: 39
Rep: 
|
Quote:
Originally Posted by TB0ne
And is there a reason your 'friend' can't post their own questions???
|
The original post stated that it was from a Chinese forum. It would be logical to think that the 'friend' doesn't understand English well enough to post here. It would also be logical to believe that has English as a second language might not understand all the nuances of the English language. Saying 'within' could have multiple meanings.
|
|
|
1 members found this post helpful.
|
07-25-2025, 01:27 PM
|
#15
|
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 28,359
|
Quote:
Originally Posted by Steve48220
The original post stated that it was from a Chinese forum. It would be logical to think that the 'friend' doesn't understand English well enough to post here. It would also be logical to believe that has English as a second language might not understand all the nuances of the English language. Saying 'within' could have multiple meanings.
|
Also logical to think that if the OP can communicate, their 'friend' can as well, and can go to the OP for any misunderstandings/miscommunications.
|
|
|
|
All times are GMT -5. The time now is 06:10 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|