Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of hyphen in '-rwxrwxrwx'

I'm using linux ubuntu server. When I'm checking file permissions with ls -l. All file permissions are starting with hyphen (-).

Example:

-rwxrwxrwx  1 www-data www-data   418 Sep 25  2013 index.php
-rwxrwxrwx  1 www-data www-data 19930 Apr  9 23:50 license.txt
-rwxrwxrwx  1 www-data www-data  7194 May  7 20:43 readme.html
-rwxrwxrwx  1 www-data www-data  4896 Dec 24  2013 wp-activate.php
drwxrwxrwx  9 www-data www-data  4096 Jul 18 10:03 wp-admin
-rwxrwxrwx  1 www-data www-data   271 Jan  8  2012 wp-blog-header.php
-rwxrwxrwx  1 www-data www-data  4818 Feb 18 21:45 wp-comments-post.php
-rwxrwxrwx  1 www-data www-data  3361 Jul 18 10:02 wp-config.php
-rwxrwxrwx  1 www-data www-data  3087 Oct 24  2013 wp-config-sample.php
drwxrwxrwx  5 www-data www-data  4096 Jul 18 10:14 wp-content
-rwxrwxrwx  1 www-data www-data  2932 Sep 25  2013 wp-cron.php
drwxrwxrwx 12 www-data www-data  4096 May  8 17:45 wp-includes
-rwxrwxrwx  1 www-data www-data  2380 Oct 24  2013 wp-links-opml.php
-rwxrwxrwx  1 www-data www-data  2359 Oct 24  2013 wp-load.php
-rwxrwxrwx  1 www-data www-data 32671 Apr 13 16:06 wp-login.php
-rwxrwxrwx  1 www-data www-data  8235 Nov 13  2013 wp-mail.php
-rwxrwxrwx  1 www-data www-data 11070 Apr  7 20:15 wp-settings.php
-rwxrwxrwx  1 www-data www-data 25665 Nov 13  2013 wp-signup.php
-rwxrwxrwx  1 www-data www-data  4026 Oct 24  2013 wp-trackback.php
-rwxrwxrwx  1 www-data www-data  3032 Feb  9 20:39 xmlrpc.php

What is the meaning of this hyphen?

Some permitions are started with d.

I can't understand this first position character. Please help me.

Note: I know about this chars r = read , w = write , x = execute.

like image 206
Chandra Nakka Avatar asked Jul 22 '14 14:07

Chandra Nakka


2 Answers

Here are the possible values of the first character from the manual (type man ls at the command line):

       b     Block special file.
       c     Character special file.
       d     Directory.
       l     Symbolic link.
       s     Socket link.
       p     FIFO.
       -     Regular file.
like image 74
r3mainer Avatar answered Oct 14 '22 06:10

r3mainer


d is for directory. So those that have - are not directories.

like image 37
nicolas Avatar answered Oct 14 '22 05:10

nicolas