- Display current hostname.
- changing the current hostname.
- Determining whether the CPU is 32/64 bit.
- Determining the whether the OS installed is 32/64 bit.
- Becoming a sudoer
- How to mount windows shares on your linux machine?
hostname
Changing the host name : Edit the file /etc/hostname
Determining whether the CPU is 32/64 bit:
Method 1:
uname -m
Method 2:
cat /proc/cpuinfo|grep flags
The answer I get on my machine is:
In the above listing look at the colored flag. The flag “lm” means, Long Mode. (64bit Extensions, AMD’s AMD64 or Intel’s EM64T). For more information on CPU flags look at CPU feature flags and their meanings
Determining the whether the OS installed is 32/64 bit: uname -a
Becoming a sudoer: $/etc/sudoers
file will show the groups which can do administrative tasks. In my machine it shows like this:
%admin ALL=(ALL) NOPASSWD:ALL
This means that all users belonging to the admin group can use sudo command. The NOPASSWD means that it will not ask for password when you use the sudo command.
$groups
command will show what all groups you belong to. So if you are not a member of admin group, as shown by the groups command, just edit /etc/group
file, add your user id to the admin group. My /etc/group
file admin group entry looks like this.
admin:x:119:suresh
Now you are ready to use sudo.
How to mount windows shares on your linux machine?
mount -t cifs //windows_share /mnt/ -o user=your_domain\\your_user_name
The abouve command mounts the specified windows share as /mnt
in your machine.
You may have to install smbfs as shown below if the above command gives an error message.
aptitude install smbfs
Hi.
Glad my page of cpu flags is helping one more guy.
However, regarding the change of the hostname, you usually don’t do that by only changing /etc/hosts. Usually, you also need to edit /etc/hostname (on Debian systems for example) or some other file (I think it is /etc/sysconfig/network on RedHat/Fedora systems). Editing the 127.0.0.1 entry in /etc/hosts has the same effect in some aspects, but has negative effects in some other cases.
regards,
Sven
By: Sven Mueller on August 24, 2010
at 6:54 pm
Hi Sven,
Thanks for pointing it out. I am editing the page. It is /etc/hostname only. It was my mistake that I wrote /etc/hosts! Actually we edit /etc/hosts to change the ip address or add an alias etc.
regards
suresh
By: sureshamrita on August 24, 2010
at 7:02 pm