Command line essentials

apt

installs and uninstalls software on Ubuntu/Debian systems. For example:

sudo apt install firefox

sudo apt remove firefox

apt list

sudo apt-get update

´‘sudo apt-get update‘‘ downloads the package list from the repositories and updates them to get information about the newest packages and their dependencies.


lshw


Will show a complete overview concerning a systems hardware:


lscpu

will print info about the cpu type onto the shell

sudo lshw –short

will print the information onto the shell

sudo lshw -html >hw.html

will write the information in a html document

sudo lshw -xml >hw.xml

will write the information in an xml document

free


free -m

Will show how the memory is used

tree


Note that this shell program is not always installed by default, if not installed type "sudo apt install tree".


Examples:


$ tree


$ tree -d


$ tree -l number


-d will show only the directories, -l number will provide the depth, ie.: $ tree -l 3 will show the structure down to the 3rd level.

uptime

uptime

Will show: the current time, how long the system has been running, the number of users currently logged on, the system load avereages for the past 1, 5, 15 minutes

ping

Will tell if an intersite (ping www.wikipedia.org) or a local system (ping -c 4 192.168.0.10) is available


ssh

To login via secure shell on a remote computer:

ssh user@192.168.0.102

to login as user on the computer with IP-adress 192.168.1.102