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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-05-2005, 08:37 AM
|
#1
|
Member
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438
Rep:
|
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.
|
|
|
10-05-2005, 09:14 AM
|
#2
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
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.
|
|
|
10-05-2005, 12:00 PM
|
#3
|
Senior Member
Registered: Sep 2005
Location: France
Distribution: LFS
Posts: 1,596
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 11:41 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|