• RSS
  • subscribe
  • twitter

Linux F.A.Q – part I

I) Is it possible to change the name of your Linux box?
The name assigned to your system at the moment of installation usually Host (at times Hostname, or end system) simply serves to classentify your PCs. If not stated, the default name becomes localhost. In all GNU/Linux distributions this information is conserved in /etc/hostname; its in this file that the name of your box is stored. Its clear that to change the Hostname its enough to modify the string in the /etc/hostname file.

A faster way to change the name of your Linux/PC is to use the command hostname

~$ hostname – gives the name of your box
~$ hostname Peter – changes your PC’s name to Peter

II) What does the /tmp directory contain? Can we empty it? Liberating space on your hard disk. Here what applies to Windows applies to Linux; Empty Trash, Jpeg pictures occupy less space etc. Here will try to obtain more space from the /tmp directory.
Most application running during the normal use of the PC use the /tmp directory as an archive for a few files, usually temporarily files necessary for the running of the program. In some this directory becomes over crowded ; use

du -h /tmp

to verify its state. If crowded then it is necessary to clean it up, but you can clean it up only before any program can writes into it, in other words you can clean it up only at start up or boot-up. To do this its enough to put a little script in the /etc/init.d folder. This directory takes care of boot-up services. Some distributions take care of the clean-up automatically, if yours does not then this script is for you:

#! /bin/bash
rm -Rf /tmp/*