LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 10-05-2012, 01:36 AM   #1
Banquo
Member
 
Registered: May 2012
Distribution: Ubuntu
Posts: 63

Rep: Reputation: Disabled
Cross platform folder naming conventions


Hello All,

I have Ubuntu and Windows 7 running on my laptop. I also have an external HD where I keep files that are accessed by both OSes. Recently, Ive been doing some reorganizing of my files on the external drive, and had the idea of making some folders appear at the top of the folder list in Win explorer. Google search suggested that I add a "!" to the beginning of a folder name to make it appear at the top. But I wasn't sure if that would be Linux compatible,or to be specific, compatible with most flavors of Linux.

I do most of these projects under windows, but don't want to "confuse" Linux with a purely Windows naming scheme. What rules are there as far as characters that both OSes can use in folders? I'd like to further tweak my filing system if it won't create havoc

Last edited by Banquo; 10-05-2012 at 01:40 AM.
 
Old 10-05-2012, 06:28 AM   #2
Lone_Wolf
Member
 
Registered: Jul 2007
Location: Netherlands
Distribution: Archlinux x86_64
Posts: 48

Rep: Reputation: 20
Linux sorting tends to be ASCII based, and to avoid locale and case-sensitivity issues, you should stick to standard ASCII codes.

The ! is one of the standard ASCII symbols that is placed before alphabetic and digit characters in sort order, so it is a possible choice.

My personable favorite for getting files or folders above others though is the _ (underscore) .
(it's easily seen, but feels less intruding then !) .
 
Old 10-05-2012, 06:37 AM   #3
Banquo
Member
 
Registered: May 2012
Distribution: Ubuntu
Posts: 63

Original Poster
Rep: Reputation: Disabled
Hmm, I see your point. An "!" may suggest; "WOAH! Crazy stuff in this folder!" If underscores will work then I think I will go with that.

I've also taken to using underscores in place of spaces in my Windows folder names to ensure compatibility, although I'm not sure how necessary that is. I know that spaces have been known to cause frustrations but so far Ubuntu hasn't given me a hard time about them. Better safe than annoyed I guess.
 
Old 10-05-2012, 11:36 PM   #4
hydraMax
Member
 
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467
Blog Entries: 60

Rep: Reputation: 51
Quote:
Originally Posted by Banquo View Post
Hello All,

I have Ubuntu and Windows 7 running on my laptop. I also have an external HD where I keep files that are accessed by both OSes. Recently, Ive been doing some reorganizing of my files on the external drive, and had the idea of making some folders appear at the top of the folder list in Win explorer. Google search suggested that I add a "!" to the beginning of a folder name to make it appear at the top. But I wasn't sure if that would be Linux compatible,or to be specific, compatible with most flavors of Linux.

I do most of these projects under windows, but don't want to "confuse" Linux with a purely Windows naming scheme. What rules are there as far as characters that both OSes can use in folders? I'd like to further tweak my filing system if it won't create havoc
http://serverfault.com/questions/208...vent-not-found

I think, strictly speaking, there is no reason you can't use '!' at the beginning of a folder name under Gnu/Linux. However, you should be aware (see above link) that an exclamation point at the beginning of a word has a special interpretation in bash (the most common shell, of course). Bash translates such a word into the most recent command that begins with the letters after the exclamation point. So something like this can happen: (Imagine you have a folder called !ec.)

Code:
$ echo "blah"
blah
$ ls !ec
ls echo "blah"
ls: cannot access echo: No such file or directory
ls: cannot access blah: No such file or directory
So, whenever referring to the !ec folder in any way from the bash command line, you would have to single-quote it, or otherwise escape it. In other words, possible inconveniences or mistakes may arise, similar to using spaces in a folder or file name.
 
Old 10-07-2012, 10:07 PM   #5
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,311

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
Quote:
I've also taken to using underscores in place of spaces in my Windows folder names to ensure compatibility, although I'm not sure how necessary that is. I know that spaces have been known to cause frustrations but so far Ubuntu hasn't given me a hard time about them. Better safe than annoyed I guess.
I'm guessing the reason spaces in names on Ubuntu hasn't caused an issue yet is because you work at the GUI level and the File Mgr (whatever its called) handles that invisibly for you.
However, if you have to work at the cmd line, it will cause issues.
In fact, given that the GUI is just a layer over the top of the cmd line, you will get issues anyway sooner or later when it calls another tool in cli context in the background.
 
Old 10-08-2012, 12:43 AM   #6
hydraMax
Member
 
Registered: Jul 2010
Location: Skynet
Distribution: Debian + Emacs
Posts: 467
Blog Entries: 60

Rep: Reputation: 51
Quote:
Originally Posted by chrism01 View Post
I'm guessing the reason spaces in names on Ubuntu hasn't caused an issue yet is because you work at the GUI level and the File Mgr (whatever its called) handles that invisibly for you.
However, if you have to work at the cmd line, it will cause issues.
In fact, given that the GUI is just a layer over the top of the cmd line, you will get issues anyway sooner or later when it calls another tool in cli context in the background.
I hesitate to second-guess anything said by a person with 12,000+ posts! However, I think we should also be careful not to overstate the possible problems with using spaces (or other special characters). For starters, it is not quite accurate to state that "the GUI is just a layer over the top of the cmd line". With all the GUI libraries I have ever worked with, interaction with the file system is never done by outputting shell commands (though theoretically this could be done by a rather stupid programmer). Rather you call some function and pass the file path as a parameter. In such a context, spaces in a file name do not change the number or division of file paths, and are no more dangerous than they would be under Windows or any other operating system.

Even when the programmer is working with shell commands the problems resulting would not be due to the inability of the system to process said unusual characters, but simply the failure of the programmer to communicate the file path in a way that cannot be misinterpreted by the shell interpreter. But such cases, if there are any, would be confined to a few small, hacked-together utility scripts for odd purposes, and not any significant system software.
 
  


Reply

Tags
cross, folders, platform


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what are the naming conventions of gcc cross-complier? nesta Programming 1 09-14-2009 10:08 AM
cross platform folder synchronization with hamachi el kab0ng Linux - Software 0 03-01-2007 03:52 PM
Folder Naming Conventions Hitboxx Fedora 4 07-12-2006 09:58 AM
The Naming Conventions nodisk Linux - Newbie 6 12-15-2005 06:15 AM
Naming conventions ??? bigjohn Linux - Newbie 1 12-07-2003 11:25 AM


All times are GMT -5. The time now is 03:52 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration