LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 01-20-2005, 07:43 AM   #1
ddaas
Member
 
Registered: Oct 2004
Location: Romania
Distribution: Ubuntu server, FreeBsd
Posts: 474

Rep: Reputation: 30
's' in the output of ls -l


Can anyone tell me what means the first 's' in the output of ls -l ?

ex:
#ls -l

srwxr-xr-x 1 root root 0 Apr 21 2004 linc-a94-0-4cbff69b36d2



thanks,
ddaas
 
Old 01-20-2005, 08:13 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
it means it's suid bit is set. if you run that file (if it is executable) it will appear to be run by root, as root owns it, and not the person who is actually running it. this can be really handy in overcoming fundamental permissions issues
 
Old 01-20-2005, 09:00 AM   #3
ddaas
Member
 
Registered: Oct 2004
Location: Romania
Distribution: Ubuntu server, FreeBsd
Posts: 474

Original Poster
Rep: Reputation: 30
Thumbs up

thanks
 
Old 01-20-2005, 09:36 AM   #4
ddaas
Member
 
Registered: Oct 2004
Location: Romania
Distribution: Ubuntu server, FreeBsd
Posts: 474

Original Poster
Rep: Reputation: 30
When I make: chmod 4777 file_name

then I type: ls -l

-rwsrwxrwx 1 user1 group1 15 Jan 20 16:12 file_name


The 's' bit is where 'x' bit shuld be. That's OK.


But why is for the other file 's' bit where '-' or 'd' should be?

srwxr-xr-x 1 root root 0 Apr 21 2004 linc-a94-0-4cbff69b36d2
 
Old 01-20-2005, 10:56 AM   #5
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
I picked up a reference book to check on things, and here's what it said:

The first character in the output of "ls -l" is the file type.
"-" - regular file
"d" - directory
"c" - character device file
"b" - block device file
"s" - UNIX domain socket
"p" - named pipe
"l" - symbolic link

So it looks like the file is a communications socket.

The setuid, setgid, and sticky bits are indicated in positions 4, 7, and 10 respectively (counting from left - the same characters that indicate execute permissions). Setuid and setgid are represented by either a lowercase or capital "s", while the sticky bit is represented with a lowercase or capital "t". If none of the special bits are set, the permissions are displayed as "-" or "x" like normal. If one of them is set, then a capital letter is used if the same execute permission is not set. A lowercase letter is used if the corresponding execute permission is set.
 
Old 01-20-2005, 11:17 AM   #6
ddaas
Member
 
Registered: Oct 2004
Location: Romania
Distribution: Ubuntu server, FreeBsd
Posts: 474

Original Poster
Rep: Reputation: 30
Thanks a lot. Now is all clear for me.

I have 2 more questions:

1) What is that reference book?
2) What is a "Unix Domain socket"? I guess it has nothing to do with the socket from tcp/ip (ip+protocol+port).



Thanks again,
ddaas
 
Old 01-20-2005, 11:46 AM   #7
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
The book is: "Linux Administration Handbook" by Evi Nemeth, Garth Snyder, and Trent R. Hein. It covers a lot of things in good detail, but its shortcoming is the index. There are some index entries that give incorrect page numbers for topics.

As far as I understand them, a file-based socket is an interface for one process to communicate with another process. For instance, I believe the MySQL database server creates a socket when it's started. Other processes can use that socket to query the database.
 
  


Reply



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
No output through SPDIf, but analog works. How do I get output through SPDIF? seanwnz Linux - General 11 11-08-2007 11:24 AM
tv output Shibby Linux - Software 1 06-07-2005 11:35 AM
Via AC'97 5.1 Optical Output or Audigy 4.1 Output Nza Fedora 3 06-01-2004 07:49 AM
the sound gives output when using mic but no output when run a music file medo Debian 0 04-19-2004 07:17 PM
Output of ls -l Crashed_Again Linux - Newbie 4 12-11-2003 06:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:57 AM.

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
Open Source Consulting | Domain Registration