Thursday, January 22, 2015

How to Get CPU & RAM info in Linux


For CPU

1. cat /proc/cpuinfo for complete details
2. To get no. of processors/cores run below command

cat /proc/cpuinfo | grep processor | wc -l




For RAM
1. cat /proc/meminfo (for complete details)
2. free -m (currently installed & used RAM)

To find RAM slots & installed memory type below command

dmidecode | grep -A 8 'Memory'

you will see below outout. There are 2 slots available & RAM installed at both slots. Please check No. of devices & Memory Device for more info

[root@bhagwat ~]# dmidecode | grep -A 8 'Memory'
Physical Memory Array
    Location: System Board Or Motherboard
    Use: System Memory
    Error Correction Type: None
    Maximum Capacity: 16 GB
    Error Information Handle: Not Provided
    Number Of Devices: 2

Handle 0x0040, DMI type 4, 42 bytes
Processor Information
    Socket Designation: SOCKET 1155
--
        MTRR (Memory type range registers)
        PGE (Page global enable)
        MCA (Machine check architecture)
        CMOV (Conditional move instruction supported)
        PAT (Page attribute table)
        PSE-36 (36-bit page size extension)
        CLFSH (CLFLUSH instruction supported)
        DS (Debug store)
        ACPI (ACPI supported)
--
Memory Device
    Array Handle: 0x003F
    Error Information Handle: Not Provided
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 2048 MB
    Form Factor: DIMM
    Set: None
    Locator: ChannelA-DIMM0
--
Memory Device Mapped Address
    Starting Address: 0x00000000000
    Ending Address: 0x0007FFFFFFF
    Range Size: 2 GB
    Physical Device Handle: 0x0041
    Memory Array Mapped Address Handle: 0x0045
    Partition Row Position: Unknown
    Interleave Position: 1
    Interleaved Data Depth: 1

Handle 0x0043, DMI type 17, 34 bytes
Memory Device
    Array Handle: 0x003F
    Error Information Handle: Not Provided
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 2048 MB
    Form Factor: DIMM
    Set: None
    Locator: ChannelB-DIMM0
--
Memory Device Mapped Address
    Starting Address: 0x00080000000
    Ending Address: 0x000FFFFFFFF
    Range Size: 2 GB
    Physical Device Handle: 0x0043
    Memory Array Mapped Address Handle: 0x0045
    Partition Row Position: Unknown
    Interleave Position: 2
    Interleaved Data Depth: 1

Handle 0x0045, DMI type 19, 31 bytes
Memory Array Mapped Address
    Starting Address: 0x00000000000
    Ending Address: 0x000FFFFFFFF
    Range Size: 4 GB
    Physical Array Handle: 0x003F
    Partition Width: 2

Handle 0x0047, DMI type 131, 64 bytes
OEM-specific Type

Note
You can also run dmidecode -t 17 for type of RAM (DDR2/DDR3) & manufacturer.

Thursday, January 1, 2015

Edit Hosts File in Windows 8 or 8.1 With Single Command

There are so many posts on internet to edit hosts file in Windows 8,1 but none of the method worked for me.

I found a very easy way to edit the hosts file

Please run Command Prompt with Administrator privileged & run following command

attrib -r %WINDIR%\system32\drivers\etc\hosts

& that's it. Open the hosts file with your desired editor & change the file

Enjoy.....:)

Please share your comments if it's worked for you