How to change timezone linux command line

In this article we will tell you to change timezone linux command line. Location of the local time file
Linux looks at /etc/localtime to determine the current time of your machine. This can either be a symbolic link to the correct time zone or a direct copy of the time zone file.

Please use following commands for changing the timezone.

[root@ip-kapilk-pc kapil]# date
Fri Jan 22 06:35:11 MST 2010

[root@ip-kapilk-pc kapil]# ln -sf /usr/share/zoneinfo/
Africa/ Cuba GMT0 Japan Poland Universal
America/ EET GMT-0 Kwajalein Portugal US/
Antarctica/ Egypt GMT+0 Libya posix/ UTC
Arctic/ Eire Greenwich MET posixrules WET
Asia/ EST Hongkong Mexico/ PRC W-SU
Atlantic/ EST5EDT HST Mideast/ PST8PDT zone.tab
Australia/ Etc/ Iceland MST right/ Zulu
Brazil/ Europe/ Indian/ MST7MDT ROC
Canada/ Factory Iran Navajo ROK
CET GB iso3166.tab NZ Singapore
Chile/ GB-Eire Israel NZ-CHAT Turkey
CST6CDT GMT Jamaica Pacific/ UCT

[root@ip-kapilk-pc kapil]# ln -sf /usr/share/zoneinfo/EST /etc/localtime
[root@ip-kapilk-pc kapil]# date
Fri Jan 22 08:40:32 EST 2010
[root@ip-kapilk-pc kapil]#

Change TimeZone Using /etc/localtime File

For this example, assume that your current timezone is UTC as shown below. You would like to change this to Pacific Time.

# date
Mon Sep 17 22:59:24 UTC 2010

change file permissions of all files in a folder in linux

If you are new in Linux for that use this command. change file permissions of all files in a folder in linux, In this article we given commands for changing permission for all folders and files. using command you can change the permission

 

change file permission of all folder and subfolders in linux

#chmod 777 * //for chanding the all folders file permission
#chmod 777 FOLDER_NAME

Where I stuck, I want to change the Main folder and subfolders and all files persimission.
You can use following command.

#chmod -R 777 *
#chmod -R 777 FOLDER_NAME

Solved issue -Directory index forbidden by Options directive:

I want to change the default location of Apache folder which is (var/www/html).
I am using the Fedora as OS and apache 2 here. you can use following code with any linux box like centos or ubuntu. Here we solved the issue of directory.

When I inserted the following code in bottom of the httpd.conf file.
<VirtualHost *:80>
Options +FollowSymLinks
ServerAdmin siwan@yahoo.co.in
DocumentRoot /var/www/html/testfolder
ErrorLog logs/error_log_net
TransferLog logs/access_log_net
</VirtualHost>

When tried the http://localhost/ in browser, I got the default browser page.
Then I tried to look my apache error using following command:
#[root@localhost ]# tail -f /var/log/httpd/error_log

In apache error log I got following error.
[Wed Oct 07 15:59:50 2008] [error] [client 127.0.0.1] Directory index forbidden by Options directive: /var/www/html/testfolder/

I changed the AllowOverride option but nothing is happens. Then I read the welcome page text
“To prevent this page from ever being used, follow the instructions in the file /etc/httpd/conf.d/welcome.conf.”
I opend the welcome.conf file.

I found following lines in welcome.conf file.
<LocationMatch “^/+$”>
Options -Indexes
ErrorDocument 403 /error/noindex.html
LocationMatch>

I changed that to as follows:

[viral-lock message=”Solution code is Hidden! It’s Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.”]

<LocationMatch “^/+$”>
Options Indexes
ErrorDocument 403 /error/noindex.html
</LocationMatch>

[/viral-lock]

That solve my problem. Some time your selinux will cause the issue so you need to deactivate the selinux.
Some time File permission will also cause the issue.
You can change the file permission using following command, go to that directory and run following command.
#chmod 777 *

You can use above commands on any linux box. Ubuntu, centos, redhat or on fedora box.. still solution will be same.