Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 10-05-2005, 08:37 AM   #1
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438
Blog Entries: 5

Rep: Reputation: 32
file permissions OK, but command permissions?

I know the various permissions that you can set on files and directories, but how different are commands?

Every thing is meant to be a file in linux, so for the "ls" command i should be able to check out "ls" in /bin and who is allowed execute it.

But read permissions? what does read permissions on a command mean? Who wants to read binary files?

I also want to know what happens when you "ls -al" or "file" a file? That's not reading it, is it? I mean I know "more" is reading a file, but "ls"?. All you're doing is asking for a name and description.

Last edited by stabu; 10-05-2005 at 08:39 AM.
Old 10-05-2005, 09:14 AM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,224
Blog Entries: 10

Rep: Reputation: 835Reputation: 835Reputation: 835Reputation: 835Reputation: 835Reputation: 835Reputation: 835
The read bit allows you to access it. Without read you can't do the ls (unless you're root) because you don't have permission. Also find wouldn't find it. Another oddity is that you have to have the execute bit on directories to read them. Just the way it is.

The "-a" flag of ls is just so you can see "hidden" files which are those that begin with a dot (.bashrc, .profile etc...). You are correct that ls only lists files - it doesn't actually read their contents.

The "-l" flag gives a "long" listing. Without it you would see only the file names with no permissions, dates or other information.

ls -la (or -al as order doesn't matter in most flags) would give you a long listing of all files in a directory including the "hidden" files.
Old 10-05-2005, 12:00 PM   #3
Senior Member
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,591

Rep: Reputation: 79
reading permission on binaries is useful for some special purposes. For instance, if you want to create a compressed archive with commands in order to send them to another computer, your compressor need to be allowed to read the file in order to compress it.


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
command permissions zchoyt Linux - Newbie 1 05-20-2005 07:14 PM
Command line permissions Rawr101 Linux - General 4 10-16-2004 10:45 PM
permissions messed up chown command used tsayles21 Debian 3 03-30-2004 08:38 PM
locking a usage policy file/ftp file permissions gbow Linux - Newbie 0 02-16-2004 05:35 AM
Changing file permissions on a SAMBA file share apenney Linux - Software 0 02-11-2002 04:42 PM

All times are GMT -5. The time now is 10:55 AM.

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