How do I change UID of a directory

I want to change UID of a directory called /home/data. Current UID is data. I want to change it to olddata. Is it possible?

First add user to the system if not added:

sudo useradd -d /home/data -s /bin/bash -M olddata
sudo passwd olddata

Now change UID using chown command:

sudo chown NewUserName /home/data
sudo chown NewUserName:NewGroupName /home/data
sudo chown -R olddata:olddata /home/data
ls -ld /home/data

Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki