Slackware This Forum is for the discussion of Slackware Linux.
|
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.
|
|
03-07-2014, 08:11 AM
|
#1
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Rep:
|
A file name beginning with '\'.
Hi: I do not know how to erase this file (the one whose name is \rendobj\r2255):
Code:
semoi@server:~/STORE1/Nonsoft/libros/chess/nuevo$ ls -l
total 118708
-rw-r--r-- 1 semoi semoi 0 2014-03-04 20:02 \rendobj\r2255
-rwxr-xr-x 1 semoi semoi 12706934 2014-03-04 19:13 1_Bishop_&_Knight.djvu*
-rwxr-xr-x 1 semoi semoi 11554110 2014-03-04 19:13 1_Bishop_&_Knight_Endings.pdf*
-rwxr-xr-x 1 semoi semoi 34122573 2014-03-04 19:13 2_Bishop_vs_Knight,_Rook_vs_Minor_Pieces.pdf*
-rwxr-xr-x 1 semoi semoi 12441969 2014-03-04 19:13 3_Queen_Endings.djvu*
-rw-r--r-- 1 semoi semoi 2840 2014-03-07 08:52 3_Queen_Endings.txt
-rw-r--r-- 1 semoi semoi 2784 2014-03-07 07:00 3_Queen_Endings.txt~
-rwxr-xr-x 1 semoi semoi 14801249 2014-03-04 19:13 4_Pawn_Endings.djvu*
-rwxr-xr-x 1 semoi semoi 17780243 2014-03-04 19:13 4_Pawn_Endings.pdf*
-rwxr-xr-x 1 semoi semoi 17951098 2014-03-04 19:13 5_Rook_Endings.pdf*
-rwxr-xr-x 1 semoi semoi 869 2014-03-07 09:29 ren.sh*
-rwxr-xr-x 1 semoi semoi 960 2014-03-07 09:27 ren.sh~*
-rwxr-xr-x 1 semoi semoi 1050 2014-03-07 09:22 ren2.sh*
-rwxr-xr-x 1 semoi semoi 1051 2014-03-07 08:50 ren2.sh~*
semoi@server:~/STORE1/Nonsoft/libros/chess/nuevo$
Any idea how it can be deleted? Quoting the filename gives 'No such file or directory'.
|
|
|
03-07-2014, 08:17 AM
|
#2
|
LQ Guru
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509
|
Have you tried this?
Code:
rm \\rendobj\\r2255
In most cases the TAB completion should give the proper way to escape the special characters. You have just to manually escape the first one in the file name, e.g.
Code:
rm \\press_TAB_here
|
|
|
03-07-2014, 08:23 AM
|
#3
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Original Poster
Rep:
|
'\\press_tab_here' does not complete. And
Code:
semoi@server:~/STORE1/Nonsoft/libros/chess/nuevo$ rm \\rendobj\\r2255
rm: cannot remove '\\rendobj\\r2255': No such file or directory
semoi@server:~/STORE1/Nonsoft/libros/chess/nuevo$
Remarkable, isn't it? I went to the GUI and used the file manager. However there should be a way of deleting it other than using the GUI!
Last edited by stf92; 03-07-2014 at 08:26 AM.
|
|
|
03-07-2014, 08:26 AM
|
#4
|
Senior Member
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223
Rep:
|
You can try zsh auto-completion
|
|
|
03-07-2014, 08:26 AM
|
#5
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,452
|
you can also try to use wildcards:
Code:
test:
ls *rendobj*r2255
but probably
ls *2255 is enough
if it returns only your file you can try to remove it by:
rm *rendobj*r2255
|
|
|
03-07-2014, 08:34 AM
|
#6
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Original Poster
Rep:
|
A pitty, I now don't remember if I tried with the asterisks. The file is now erased for good.
|
|
|
03-07-2014, 08:38 AM
|
#7
|
Senior Member
Registered: Nov 2013
Location: Brazil
Distribution: Slackware
Posts: 1,223
Rep:
|
And what about me? Suggesting using a cannon :P
At least zsh comes by default on slackware
|
|
|
03-07-2014, 09:03 AM
|
#8
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,326
|
i think rm ./'\rendobj\r2255' would do it.
|
|
|
03-07-2014, 01:30 PM
|
#9
|
Member
Registered: Nov 2013
Posts: 748
Rep:
|
what shell are you using ?
also what terminal ?
\\TAB should work
this puzzles me
|
|
|
03-07-2014, 01:54 PM
|
#10
|
Member
Registered: Oct 2009
Distribution: Slackware
Posts: 534
|
Hehe..
ls formats the output.. The file begins with the \r (Carriage return), not with '\' That is why TAB completition or quoting didn't work
|
|
|
03-07-2014, 02:03 PM
|
#11
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Original Poster
Rep:
|
Quote:
Originally Posted by Smokey_justme
Hehe..
ls formats the output.. The file begins with the \r (Carriage return), not with '\'
|
How do you know?
|
|
|
03-07-2014, 02:16 PM
|
#12
|
Member
Registered: Oct 2009
Distribution: Slackware
Posts: 534
|
It's a console protection... \r would cause the console to move the cursor to the begining of the line (and write characters from there on).. Moreover, it's invisible otherwise.. And, as a distinction, a \ character in the filename is displayed like \\
Try it:
Code:
touch "\testfile_starting_with_the_\_character"
ls
rm "\testfile_starting_with_the_\_character"
touch $'\r'
ls
rm $'\r'
Last edited by Smokey_justme; 03-07-2014 at 02:18 PM.
|
|
2 members found this post helpful.
|
03-07-2014, 05:59 PM
|
#13
|
Member
Registered: Jun 2010
Location: Ukraine, Vinnitsa
Distribution: Slackware
Posts: 351
Rep:
|
Better say other: where do you got files with embedded \r in name?
|
|
|
03-07-2014, 06:20 PM
|
#14
|
Slackware Maintainer
Registered: Dec 2002
Location: Minnesota
Distribution: Slackware! :-)
Posts: 2,938
|
mc has also been known to easily delete strangely named files.
|
|
|
All times are GMT -5. The time now is 09:00 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
|
|