15 essential commands to check hardware information on Linux

1. lscpu

The lscpu command reports information about the cpu and processing units. It does not have any further options or functionality.

2. lshw – List Hardware

A general purpose utility, that reports detailed and brief information about multiple different hardware units such as cpu, memory, disk, usb controllers, network adapters etc. Lshw extracts the information from different /proc files.

3. hwinfo – Hardware Information

Hwinfo is another general purpose hardware probing utility that can report detailed and brief information about multiple different hardware components, and more than what lshw can report.

4. lspci – List PCI

The lspci command lists out all the pci buses and details about the devices connected to them.
The vga adapter, graphics card, network adapter, usb ports, sata controllers, etc all fall under this category.

5. lsscsi – List scsi devices

Lists out the scsi/sata devices like hard drives and optical drives.

6. lsusb – List usb buses and device details

This command shows the USB controllers and details about devices connected to them. By default brief information is printed. Use the verbose option “-v” to print detailed information about each usb port

7. Inxi

Inxi is a 10K line mega bash script that fetches hardware details from multiple different sources and commands on the system, and generates a beautiful looking report that non technical users can read easily.

8. lsblk – List block devices

List out information all block devices, which are the hard drive partitions and other storage devices like optical drives and flash drives

9. df – disk space of file systems

Reports various partitions, their mount points and the used and available space on each.

10. Pydf – Python df

An improved df version written in python, that displays colored output that looks better than df

11. fdisk

Fdisk is a utility to modify partitions on hard drives, and can be used to list out the partition information as well.

12. mount

The mount is used to mount/unmount and view mounted file systems.

13. free – Check RAM

Check the amount of used, free and total amount of RAM on system with the free command.

15. /proc files

Many of the virtual files in the /proc directory contain information about hardware and configurations. Here are some of them

CPU/Memory information

# cpu information
$ cat /proc/cpuinfo

# memory information
$ cat /proc/meminfo

Linux/kernel information

$ cat /proc/version
Linux version 3.11.0-12-generic (buildd@allspice) (gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu7) ) #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013

 

 

 

Rsync with a non-standard ssh port

While doing some work on migrating accounts to a new server, I needed to use rsync over ssh. The ssh daemon on the remote server runs on a non-standard port, and all the port related options to rsync only change settings if you’re running the rsync-daemon.

After some searching, the man page of rsync  offered a solution:

rsync -avz -e "ssh -p $portNumber" /localpath user@remoteip:/remotepath

 

Rsync (Remote Sync): 10 Practical Examples of Rsync Command in Linux

Rsync (Remote Sync) is a most commonly used command for copying and synchronizing files and directories remotely as well as locally in Linux/Unix systems. With the help of rsync command you can copy and synchronize your data remotely and locally across directories, across disks and networks, perform data backups and mirroring between two Linux machines.

This article explains 10 basic and advanced usage of the rsync command to transfer your files remotely and locally in Linux based machines. You don’t need to be root user to run rsync command.

Some advantages and features of Rsync command
  1. It efficiently copies and sync files to or from a remote system.
  2. Supports copying links, devices, owners, groups and permissions.
  3. It’s faster than scp (Secure Copy) because rsync uses remote-update protocol which allows to transfer just the differences between two sets of files. First time, it copies the whole content of a file or a directory from source to destination but from next time, it copies only the changed blocks and bytes to the destination.
  4. Rsync consumes less bandwidth as it uses compression and decompression method while sending and receiving data both ends.

Continue reading Rsync (Remote Sync): 10 Practical Examples of Rsync Command in Linux

Linux : How do you display each sub-directory size in a list format via the command line

If you want to get a list of the directories and their sizes in a list format then siply use the below:

du -h
Provides this but it displays all of the sub-folders.
du -h --max-depth=1

Alternative

If --max-depth=1 is a bit too long for your taste, you can also try using:

du -h -s *

This uses -s (--summarize) and will only print the size of the folder itself by default. By passing all elements in the current working directory (*), it produces similar output as --max-depth=1 would:

The difference is subtle. The former approach will display the total size of the current working directory and the total size of all folders that are contained in it… but only up to a depth of 1.

Add an Additional Disk Drive to Your Linux Server or VM and and partitioning it

Prerequisite: This tutorial covers adding a new disk drive to your linux computer. First it is assumed that the hard drive was physically added to your system.

IDE based systems, can support two drives on each ribbon cable. The cable is attached to either the Primary or Secondary IDE controller. A “jumper” is pressed onto two pins (thus connecting the two pins) on the drive to define the drive as a “Master” or a “Slave” drive. Each cable can support one master and one slave drive. Typically new desktop systems have one hard drive connected as a Master on the Primary controller and one CD-Rom on the second cable configured as a master. Continue reading Add an Additional Disk Drive to Your Linux Server or VM and and partitioning it

How to change the hostname in Linux

If you are new to linux you probably will wonder how to change the hostname of your computer or server. (A hostname is the unique name by which a network attached device is known on a network.) If you enter the wrong hostname during the installation, and you need to change the hostname, here is the solution:-

 

  • Edit file /etc/sysconfig/network using your favourite editor. In my case is nano. So i’ll enter  nano /etc/sysconfig/network
  • Look for HOSTNAME=xxxxxx
  • Change the xxxx to the name you wish to set for your computer. (ex: HOSTNAME=wiredgorilla.com)
  • Save the file and restart the xinetd service. (ex: type service xinetd restart in your shell)
  • Done! You have just changed your hostname in Linux platform

iOS 4.3.3: Install, Unthethered Jailbreak, Unlock with Sn0wbreeze

This is  a step-by-step guide to Install, Jailbreak and unlock iPhone 4.3.3. You may choose to jailbreak iPod Touch, iPad with the same method except leaving the options that are only available to locked iPhones. You should jailbreak factory unlocked iPhone with Redsn0w

Continue reading iOS 4.3.3: Install, Unthethered Jailbreak, Unlock with Sn0wbreeze