Jump to content
Sign in to follow this  
seeno

creating/removing filenames with spaces in them

Recommended Posts

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

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

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

[seeno@localhost seeno] rmdir 'file name'

... you get the picture ;p

Share this post


Link to post
Share on other sites
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

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

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

[seeno@localhost seeno] rmdir 'file name'

... you get the picture ;p

 

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...