LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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-2005, 09:37 AM   #1
stabu
Member
 
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 09:39 AM.
 
Old 10-05-2005, 10:14 AM   #2
MensaWater
Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,028
Blog Entries: 5

Rep: Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791Reputation: 791
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, 01:00 PM   #3
Agrouf
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.
 
  


Reply


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


All times are GMT -5. The time now is 04:28 PM.

Main Menu
Advertisement
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