How to hash files in Linux?

How many times have you needed to get the hash of any file in Linux? For whatever purpose you have needed to do that, rest assured that there is a set of commands that will make your life easier. These commands are part of Linux core utils. MD5 md5sum <file_name> SHA-1 sha1sum <file_name> SHA-256 sha256sum <file_name> SHA-384 sha384sum <file_name> SHA-512 …

How to add sudo users in Linux

First of all you have to be logged in as root. Just type command below followed by your password: terminator@skynet:~$ sudo su – [sudo] password for terminator: Now that you are root you can use the following command to create the user: adduser <username> You will be prompted for password, information and confirmation. Once done you can use the following …

How to see running processes in Linux

One essential command to know when you are experimenting in Linux is the command to see which processes are running in your machine, just in case you need to kill one of them for any reason. This command is top and you use it like this: Type top in a Linux Terminal and press Enter: pi@raspberrypi:~ $ top You should …

How to see available disk space in Linux

Playing around with a Raspberry PI I came to need this info. Here is the command: df -h You should see something similar to this: pi@raspberrypi:~ $ df -h Filesystem Size Used Avail Use% Mounted on /dev/root 26G 6.5G 18G 27% / devtmpfs 334M 0 334M 0% /dev tmpfs 463M 0 463M 0% /dev/shm tmpfs 463M 6.4M 456M 2% /run …

How to know which Linux version you are running

Easy peasy! Run the following command in a Terminal: lsb_release -a You should see something similar to this: pi@raspberrypi:~ $ lsb_release -a No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 10 (buster) Release: 10 Codename: buster

How to reset Raspbian 10 (Buster) password on Raspberry PI 4

Hey! if you are reading this chances are you forgot the password to your Raspberry PI. Worry not though here is how to reset it on Raspbian 10 Buster using a Raspberry PI 4, I don’t really think the model of Raspberry PI matters but it’s just to give you a better idea of my environment. First start your Raspberry …

How to find strings in files in Linux

Today I needed to search for a specific string in all files inside a SOAP UI project, you just need to execute the following command: grep -rnw “getList” /home/SOAPUI_Proj/ Please notice that the text in italics means that the value is variable. Sources http://www.cyberciti.biz/faq/howto-search-find-file-for-text-string/ http://stackoverflow.com/questions/16956810/finding-all-files-containing-a-text-string-on-linux

How to change keyboard layout in CentOS Linux

Today I ran into the problem of installing a virtual machine that has a french keyboard layout.  I have a US keyboard so it’s clear that I needed to change. Here’s how to do it from console. Open the keyboard file for editing vi /etc/sysconfig/keyboard You will see something like this: Change KEYTABLE and LAYOUT from “fr” to “us” Save it …

How to change IP address on CentOS Linux

A few weeks back I needed to change my IP address on a Linux CentOS installed in a VirtualBox machine. Here is how to do it: ifconfig eth0 192.168.0.34 ifconfig eth0 netmask 255.255.255.0 Sources: http://www.tecmint.com/ifconfig-command-examples/ http://christophermaier.name/blog/2010/09/01/host-only-networking-with-virtualbox