Very useful Linux commands Another way to get the uptime of the system. awk ‘{printf("Uptime: %d:%02d days, %02d minutes, %02d seconds.\n",($1/60/60/24),($1/60/60%24),($1/60%60),($1%60))}’ /proc/uptimeawk ‘{printf("Uptime: %d:%02d days, %02d minutes, %02d seconds.\n",($1/60/60/24),($1/60/60%24),($1/60%60),($1%60))}’ /proc/uptime Find the actual device name of the drive that contains your root partition. ip-172-31-20-16:~> findmnt -n -o SOURCE / /dev/xvda1ip-172-31-20-16:~> findmnt -n -o SOURCE / …

The ethtool utility for Linux is very good at getting information about your Ethernet adapter. Below is the standard information that is available concerning the basic abilities of the Ethernet adapter. localhost% ethtool enp0s25 Settings for enp0s25: Supported ports: [ TP ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Supported pause frame use: No …

The type command for bash will tell you whether a command is a shell built-in or an executable on it`s own. This is very simple to use. This example shows how it works. [email protected]:~$ type -a echo echo is a shell builtin echo is [email protected]:~$ type -a echo echo is a shell builtin echo is …

The smartmontools package for Debian allows the user to get comprehensive hard disk information. This is useful if the hard disk drive is behaving strangely. This might mean it is failing. Install the smartmontools package. [email protected]:/home/jason# apt install [email protected]:/home/jason# apt install smartmontools Now you may check your hard disk drive for any errors. [email protected]:/home/jason# smartctl …

This useful command will display a count of all installed packages on your Debian Linux machine. [email protected]:~$ dpkg-query -l | wc -l [email protected]:~$ dpkg-query -l | wc -l 2027 Grepping the output to find certain packages. [email protected]:~$ dpkg-query -l | grep vim ii vim-common 2:7.4.052-1ubuntu3 amd64 Vi IMproved – Common files ii vim-tiny 2:7.4.052-1ubuntu3 amd64 …

List all network interfaces on your Linux machine that are up. [[email protected] ~]$ ip addr | grep UP 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000 3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN[[email protected] ~]$ ip addr | grep UP 1: lo: …

While running Linux, if you want to list the contents of a folder in a vertical list format, just use the ls command with these switches. [email protected]:~$ ls -luh –color=yes total 48K drwxr-xr-x 2 jason jason 4.0K Dec 15 03:03 Desktop drwxr-xr-x 2 jason jason 4.0K Nov 29 17:00 Documents drwxr-xr-x 2 jason jason 4.0K …

There are a few commands available in Red Hat Linux to get information about your network adapter. Here are a couple. The ifstat command returns information about the network throughput of your adapter. [[email protected] ~]$ ifstat #kernel Interface RX Pkts/Rate TX Pkts/Rate RX Data/Rate TX Data/Rate RX Errs/Drop TX Errs/Drop RX Over/Rate TX Coll/Rate lo …

The hwinfo command for Linux will allow the user to get hardware information from the command line. Type sudo apt-get install hwinfo to install this command. It will be installed in the /sbin directory and therefore, you will need superuser privileges to execute this command and get the hardware information. [email protected]:~$ sudo apt-get install [email protected]:~$ …

This command lists the information about your user. C:\Users\homer&gt;net user Administrator User name Administrator Full Name Comment Built-in account for administering the computer/domain User’s comment Country code 000 (System Default) Account active No Account expires Never   Password last set 11/2/2006 11:08:15 PM Password expires Never Password changeable 11/2/2006 11:08:15 PM Password required Yes User …

The mount command shows information about your mounted partitions on your machine. iMac305:~ admin$ mount /dev/disk0s2 on / (hfs, local, journaled) devfs on /dev (devfs, local, nobrowse) map -hosts on /net (autofs, nosuid, automounted, nobrowse) map auto_home on /home (autofs, automounted, nobrowse) map -fstab on /Network/Servers (autofs, automounted, nobrowse) /dev/disk0s3 on /Volumes/Scratch (hfs, local, journaled)iMac305:~ …

Linux hardware information commands. There are many commands available for Linux that allow the user to get information about their hardware. Here is a handful of them. The lshw command. deusexmachina description: Notebook product: eME730 (Calpella_CRB) vendor: eMachines version: V1.15 serial: LXN98020810441E9781601 width: 64 bits capabilities: smbios-2.6 dmi-2.6 vsyscall32 configuration: boot=normal chassis=notebook family=Intel_Mobile sku=Calpella_CRB uuid=40198687-F9A4-2099-05F2-88AE1D6D09BC …

Some useful links and bits of information for budding Linux users. Bash cheat sheet. http://www.catonmat.net/download/bash-history-cheat-sheet.pdf. This is a very useful bash cheat sheet that will greatly assist you when you are learning the bash shell. (PDF). The .bash_history file may be blocked by using the unset HISTFILE variable in your .bashrc file. Read more about …