Why Gedit thinks my notes are "executable text files" ?

Asked by Wladston Viana

I wonder why Gedit keeps thinking that the notes I create are "executable text files", since they don't have the .sh ending.

If I configure gedit not to ask to execute, the .sh files won't execute anymore :(

Anyone can help me ?

Thanks! ;)

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gedit Edit question
Assignee:
No assignee Edit question
Solved by:
Chris Kirk
Solved:
Last query:
Last reply:
Revision history for this message
Chris Kirk (sktx) said :
#1

It's likely that your notes file has executable permissions. If that's the problem, it can be fixed by typing...

chmod a-x /path/to/notes/file.txt

...into a terminal window or at the console. Of course, you'll remember to change /path/to/notes/file.txt to the actual path to your notes file ;)

-Chris.

Revision history for this message
fatsheep (jesse-fatsheep-deactivatedaccount) said :
#2

Just right click on the file, go to properties, select the permissions tab and then make sure the executable boxes are NOT checked. :)

Revision history for this message
Wladston Viana (wladston) said :
#3

Oh - this was it - thanks guys!

Now, please, allow me to change the question : Why is ubuntu detecting my simple txt files as executables, and, is there a way for him to mark my .txt text files as "not executable" automaticaly ?

Revision history for this message
Jonathan Anderson (jonathan-anderson) said :
#4

Did they come from Windows? Are they on a Windows "shared drive"? Since Windows doesn't have an executable bit, Linux treats all Windows (or SMB-shared) files as executable, just in case.

Revision history for this message
Ubuntu User (anotherubuntuuser) said :
#5

If these comments answered your question, please consider closing this ticket. If not, please let us know and we'll keep working with you to resolve your issue.

Thanks

Good Luck

Jim Jones

Revision history for this message
Wladston Viana (wladston) said :
#6

Yeah - they did come from windows - from my backup before wiping the windows partition....

But tell me .... no executable on windows runs at Ubuntu, so I really don't get the point in assuming the windows files are executable files.... Why not to treat the files (specially the ones that end with .txt) as non-executable files ?

Revision history for this message
Jonathan Anderson (jonathan-anderson) said :
#7

Why / why not? I'm not really sure... that's a question for the Samba
developers. I think that Windows *does* have separate "Read" and "Read &
Execute" permissions, but they're never really used (or something like
that... I'm certainly no expert).

Anyway, to remove the executable bit from a whole tree, run the following:

chmod -x `find /path/to/files -type f`

Note the use of backticks, not single quotes...

Revision history for this message
Wladston Viana (wladston) said :
#8

well, the files I'm refering to are not on a windows dir - they were copyed from the old "my documents" folder ....

Thanks for the hint, it was very usefull!

So you mean that the Ubuntu developers _wanted_ this problem to happen ? Ubuntu trying to execute windows text files ?

Revision history for this message
Wladston Viana (wladston) said :
#9

This is what I get :
wladston@wlad:~$ chmod -x `find ~ -type f`
bash: /bin/chmod: Argument list too long

Revision history for this message
Alexandre Vassalotti (avassalotti) said :
#10

You should use:
$ find path/to/files -type f -print0 | xargs -0 chmod -x

Although, be careful while changing file permissions.

I think it's possible to ignore the executable bit for file on Windows partitions. I'm not sure, exactly how, but it would involve setting the correct masks in /etc/fstab

Try:
$ gksudo gedit /etc/fstab

Locate the line for your Windows partition. And change it, so it looks like this:
/dev/[xxx] /media/windows ntfs user,fmask=0111,dmask=0000 0 0

Change [xxx] for the device name of the partition. If you're using an older version of Windows (prior Windows 2000), the partition type should be `vfat' not `ntfs'.

P.S. Try opening a new request, when you got a new question.

Revision history for this message
Wladston Viana (wladston) said :
#11

ok, thanks!

It's not actually a windows partition, the filesystem is ext3, but these files were copyed from the windows partition....

I guess my ideas are more like a request - I'll create one.

Revision history for this message
Bernhard (b.a.koenig) said :
#12

Actually, I agree with Wladston. Files should not be executable just because they come from a FAT partition.