Linux-Noob Forums
creating/removing filenames with spaces in them - Printable Version

+- Linux-Noob Forums (https://www.linux-noob.com/forums)
+-- Forum: Linux Noob (https://www.linux-noob.com/forums/forum-3.html)
+--- Forum: Tips and Tricks (https://www.linux-noob.com/forums/forum-59.html)
+---- Forum: Filesystem Management (https://www.linux-noob.com/forums/forum-26.html)
+---- Thread: creating/removing filenames with spaces in them (/thread-3440.html)



creating/removing filenames with spaces in them - seeno - 2004-04-22


I was reading a doc about linux and figured out this trick, (i don't know if most of you know about it, so please don't flame me if you do :P).

Ok, you can create file/directory names in bash with spaces in them using ''.

e.g

Code:
[seeno@localhost seeno]$ mkdir 'file name'






Code:
[seeno@localhost seeno]$ pico 'text file'






Code:
[seeno@localhost seeno] rmdir 'file name'




... you get the picture ;p




creating/removing filenames with spaces in them - terreaultguy - 2008-02-09


Quote:I was reading a doc about linux and figured out this trick, (i don't know if most of you know about it, so please don't flame me if you do :P).Ok, you can create file/directory names in bash with spaces in them using ''.

e.g

Code:
[seeno@localhost seeno]$ mkdir 'file name'

<div>




Code:
[seeno@localhost seeno]$ pico 'text file'






Code:
[seeno@localhost seeno] rmdir 'file name'




... you get the picture ;p

</div>
 

I got to read this post by googling "spaces in Linux file names".

 

I also read the post that says that in terminal just start to type the first letters of the file name and use [tab]

and the file name is auto completed say the file is "My budget" it will complete it with the escape "\" like My\ budget.

 

that is good to. The problem with spaces in filenames is that some apps like yester day I was using an programming IDE that created with a wisard all the files and directories need for a costum app and some folders had spaces in it.

For creating every thing no problem. But when it came to compile the new app it did not put the "" around the filenames. nor did it put the \ so errors of compilation occurd saying that the path was not found.

 

So using spaces is a bad practice. so i had to change all the spaces to "-" and the compiler worked fine.

 

If some one has other solution let me know.

 

bye, Guy