-2

When I did ls -al after cd /etc/apache2/sites-enabled I see the following

drwxr-xr-x 2 root root 4096 Aug 11 08:18 .
drwxr-xr-x 8 root root 4096 Aug 11 06:01 ..
lrwxrwxrwx 1 root root   56 Aug 11 01:19 abc.com-le-ssl.conf -> /etc/apache2/sites-available/abc.com-le-ssl.conf
lrwxrwxrwx 1 root root   39 Aug 11 01:14 abc.com.conf -> ../sites-available/abc.com.conf
lrwxrwxrwx 1 root root   35 Aug 10 23:55 abc.conf -> ../sites-available/abc.conf
  1. What does -> means?
  2. Why doesn't -> show up when I do ls or ls -a ?
1

3 Answers 3

2

That just indicates that the file is a symbolic link, and the path on the right hand side of the arrow is the contents of the symbolic link. This information doesn't show up when you don't include -l in your ls command, because it is only shown when "long" output format (what the -l means) is requested.

1
  1. The arrow is a symbolic link. It’s simply a reference to another file path. When a symbolic link is encountered (which is stored as a special text file on disk with the name of the destination) it then follows the link and opens the file it points to. It’s basically a “see here”. Links do not have permissions and only the permissions on the destination file matter.

This is used because the files existing in sites-available usually, can be activated and deactivated by removing the link without impact on the original file. Edits to the file happen to the destination of the link.

  1. The -l is a detailed list. Without the -l you just get a list of file names and no further detail.

Try playing with it. Links can be made with “ln -s destinationfile newname” or “ln -s /path/to/file newname”

1

@sofs1

1) welcome to the Management of sites. Config's will be saved unter apache or nginx/site-avaible and will be enabled by link These files to site-enabled as the folder tells this Arms the site into the configuration of These Webservers.

apache2: (enable) 
a2ensite mysite.com
 apache2: (disable) 
 a2dissite mysite.com

2)

Usage: ls [-1AaCxdLHRFplinshrSXvctu] [-w WIDTH] [FILE]...

List directory contents
    -a      Include entries which start with .
    -A      Like -a, but exclude . and ..
     -l      Long listing format

ls is listing as default a Long Format, only -a is like all showing file

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .