Categorie

Archivio Articoli

Categorie

Commenti recenti

[bash] md5/sha1 and other commands in a bash variable


 

 

 

 

 

 

Create a bash script (in my case I've called it 'cryptotest') with those commands:

#!/bin/bash

filename="filename.txt"
md5="$(md5sum "${filename}")"
md5="${md5%% *}" # remove the first space and everything after it

sha1="$(sha1sum "${filename}")"
sha1="${sha1%% *}" # remove the first space and everything after it

echo md5 =  "'$md5'"
echo sha1 = "'$sha1'"

Give it execute permission:

$ chmod a+x cryptotest

Execute it:

$ ./cryptotest

obtaining:

$ md5 = '40d5fd4f88036501efcd73ab87a037fc'
sha1 = 'd67aef9d1a5cb5ef73bb0a028fc1bbf83c8ec718'

Linux: il nostro processore supporta l’architettura 64bit? Ecco come saperlo

Linux: il nostro processore supporta l'architettura 64bit? Ecco come saperlo.

Ed altre informazioni utili sul nostro processore...

Directory Size with Linux Terminal | Ryan Rampersad

 

 

 

Conoscere la dimensione delle directory da terminale.

Directory Size with Linux Terminal | Ryan Rampersad.