Linux Tips

From Tekkotsu Wiki

Jump to: navigation, search

Contents

Tutorials for Building Linux Skills

Finding Your Linux Version Information

To check which version of Linux you are running, try either of these commands:

cat /etc/lsb-release
cat /etc/issue

Changing Ownership Of A Directory Tree

A common mistake when installing Tekkotsu is to copy the project directory into a user's directory as root instead of as that user. This makes the directory and everything below it owned by root, so the user will not be able to edit those files or compile their Tekkotsu applcation. Another way to cause this same problem is to do a "cvs update" or a "make" as root when in the /home/user/project directory. To fix the problem, do this:

sudo -s
cd /home/user/project
find . -exec chown user:user \{\} \;
exit

Changing The Name Of A Computer

sudo -s
gedit /etc/hostname
reboot

Changing The Name Of A User

Assuming you want to rename user oldname to newname:

sudo -s
gedit /etc/passwd
gedit /etc/shadow
gedit /etc/group
  # be sure to change all the occurrences of oldname to newname
cd /home
mv oldname newname
exit
logout