Tag Archives: string

Create md5 from string im Linux

How to install?
Create new file

nano /usr/bin/md5

copy&paste code to /usr/bin/md5

chmod:

chmod +x /usr/bin/md5

Code:

#!/bin/sh
if [ $1 ]
then
        hash="$(echo -n "$1" | md5sum )"
        echo "$hash"
else
        echo "Example usage: md5 <you-string>"
fi

Usage and Output:
root@host:~# md5 sebastian
c2d628ba98ed491776c9335e988e2e3b  –

Linux commands to help me work

Search for files and directories given text, a very useful feature when you want to find the text and does not know where the file or directory is.

grep -i -n -r 'Search string' /var/www/path/

shows how many times is the search text in the text and returns the result in numbers.

cat access.log|grep 'Search string' | wc -l

while

while true; do COMMEND; done