When surfing to any subfolder in my web site the browser displays the list of files in that directory. I would like to add an empty index.html file to fix this,  How can I do it with a shell script or a CLI command?  You could disable directory indexes. Via .htacces: put this line in the root .htaccess:  Options -Indexes
123152
When I access a directory hosted by Apache that does not have a index.php file or similar, Apache lists the content of the directory for me. How can I block this? I'm using Apache2 on Ubuntu.
83017
I have an empty directory. I am using following command to view the contents of that directory. ls -lart  The output I get is below. total 12 drwxr-xr-x 5 root  root  4096 Oct  2 12:26 .. drwxr-xr-x 2 apx   aim   4096 Nov 29 18:40 .  I don't have any files in this directory, then what counts out to 12 here (total 12)?
32697
I accidentally made a directory "~/" under a subdirectory in my home directory. How to safely remove this directory without affecting my home directory. rm -r ~ obviously won't work... Thanks!
98286
When I open my website it shows me this:  The following directories must be writable by the web server: tmp/cache tmp/templates_c  Please correct by executing: chmod 777 tmp/cache chmod 777 tmp/templates_c or the equivilent for your platform before continuing.   When I run these 2 commands it tells me that these directories don't exist.  How can I solve this problem
48647
I just upgraded to 7.25 from 7.19, and now in my Status Report I have a red X on my "Public Files" and "Temporary Files".     See  for information about the   recommended .htaccess file which should be added to the   sites/default/files directory to help protect against arbitrary code   execution.   I go to the address above, but I don't have any user friendly explanation of what to do to fix this. Thanks in advance.  Update: (1/8/14)  The answer below fixes the Public files problem 100%.  It does not fix the Temp files. To fix temp files, I go to admin/config/media/file-system and change the path from /tmp to ../tmp  I will update this if this is fixed in a newer version of drupal, or if there is another fix available. I'm not sure if the ../tmp is the correct solution, but it works.
108004
Is there any way of batch renaming files in sub directories?  For example:  Rename *.html to *.htm in a folder which has directories and sub directories.
124182
I want to list all the files, in directory I am currently in, with for example &quot;a&quot; in their name. I know that the first part of the command would be ls -l, but i do not know how to finish it.
80404
How can I find every empty directory, let's say, on the /home/.../Desktop. Because I am on Solaris, I can't use the find . -empty -type d command. Is there any other way?
121467
This is exactly what I have set up right now:   cd /var/www mkdir -p test cd /var/www/test sudo nano index.html cd /etc/apache2/sites-available sudo nano test.conf   &lt;VirtualHost *:80&gt;     ServerName localhost223.com     DocumentRoot /var/www/test &lt;/VirtualHost&gt;    $sudo a2ensite test.conf $sudo service apache2 reload   I can access my page like this:file:///var/www/test/index.html in web browser.  &lt;html&gt;     &lt;h1&gt;          here     &lt;/h1&gt; &lt;/html&gt;   But I cannot do access: http://localhost223.com  I get the error: Could not resolve host  How to resolve this issue?
66861
I want to replace all my website files for new ones on the server and to test if they work alright but I don't want to be crawled while this is happening or if I am,  I don't want the crawler to be able to see what's in the new page.  I just want to change it for like 15min but i tested other stuff once for 5min and google for webmasters told me they had a lot of 404's during that period and I don't want that to happen again.   Besides that I don't want to have to write my whole .htaccess file. I considered redirecting all the urls to my main page and apply the changes but I think this isn't probably a good practice, any good ideas?
49601
I want to limit my users to a directory and its sub directories but the "Parent Directory" button allows them to browse to an arbitrary directory.  How should I go about doing that?
111826
Is there a way to exclude all files, in all subfolders, and keep the folder structure?
46436
I am writing a small website, but I do NOT want to figure out how to install and configure complete LAMP stack to test the website from my ~/home directory. That will be completely disruptive and unnecessary.  All I want is to have a directory, e.g. ~/home/Documents/Website and run a small web server from that folder as the website's "home" folder.  I know  can do something similar, but it only seems to work with Ruby/Jekyll-based sites that it builds and configures.  Isn't there some small web server program that I can easily install and then just run very simply?  For instance, if I just needed to run something like e.g. simple-server serve ~/home/Documents/Website from a command line and then navigate to e.g. localhost:4000 or whatever to test the site, that would be perfect.  If this is already possible in Ubuntu and I just don't know how, please let me know.
9575
WordPress itself, in the wp-content folder, includes an empty PHP file which looks like this.  &lt;?php // Silence is golden. ?&gt;   Should plugins include an empty file like this as well to stop folks view viewing the contents of a directory?  What about additional folders in themes -- like an includes directory?
42577
I'm trying to recursively search a directory tree to find all of the .asp files using the following command:  dir *.asp /s   For some reason, this returns not only the asp files, but also the aspx files.  How can I force it to ignore the aspx files?
30742
I want to exclude some large content directory  I'm Using it to chown Directory  chown -R admin /home/admin/web/public_html   is there anyway to exclude a subdirectory under html  Like:  chown -R admin exclude=/home/admin/web/public_html/content /home/admin/web/public_html   Something like that  Thanks
31750
I want to move all my drupal files in www folder to html folder. I don't know how to do this in terminal and I'm not sure if all folder and files including hidden ones are drupal in the www folder, is there a way of checking the lesser obvious ones or would www have been empty before and any hidden files will auto recreate?