Anyone know why 'Not a directory' is being output preventing me from changing timezone?

[root@server etc]# cat localtime 
cat: localtime: Not a directory
[root@server etc]# ls localtime 
ls: localtime: Not a directory
[root@server etc]# ln -sf /usr/share/zoneinfo/Eire localtime 
ln: accessing `localtime': Not a directory
[root@server etc]# ln -sf /usr/share/zoneinfo/America/Nome localtime 
ln: accessing `localtime': Not a directory
[root@server etc]# date
Thu Apr 24 09:58:44 UTC 2014
有帮助吗?

解决方案

'Not a directory error' is coming because here localtime is a symbolic link not a directory.

using command:ls -l localtime gives: lrwxrwxrwx. 1 root root 27 Oct 31 19:00 localtime -> /usr/share/zoneinfo/Etc/UTC

as output. Here 'l' in the begining means that localtime is a symbolic link.

For the command : ln -sf /usr/share/zoneinfo/Eire localtime to work,

delete the existing symbolic link localtime as : rm localtime

then use command : better see This link

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top