Linux Tips

From Tekkotsu Wiki

Jump to: navigation, search


Tutorials for Building Linux Skills

Finding Your Linux Release and Kernel Version Information

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

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

To check which kernel you're running, type:

uname -a

Updating to a Newer Linux Kernel

To check your kernel release version, do:

 uname -r

To check which kernels are available, do:

 apt-cache search linux-image

To upgrade to a newer kernel, e.g., 3.5.0-54, do:

 sudo apt-get install linux-image-3.5.0-54-generic
 sudo reboot now

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 \{\} \;

Changing The Name Of A Computer

sudo -s
gedit /etc/hostname
gedit /etc/hosts
   # Change host entry for

Create A New User Account

sudo -s
adduser jsmith
su jsmith
cp -rp /usr/local/Tekkotsu/project .

mv dot-profile .profile
mv dot-bashrc .bashrc
mv dot-cvsrc .cvsrc
cat /dev/null >~/.cvspass


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