UNCLASSIFIED

Skip to content
Snippets Groups Projects
Commit 5f03df67 authored by Phillippe Mendoza's avatar Phillippe Mendoza
Browse files

bash script

parent 67824d41
Branches
No related merge requests found
#!/bin/bash
echo -e "++++++++++++++++OS INFO+++++++++++++++" > info.txt
cat /etc/os-release >> info.txt
echo -e "====================================" >> info.txt
echo -e "++++++++++++++OS VERSION+++++++++++++" >> info.txt
lsb_release -a >> info.txt
echo -e "====================================" >> info.txt
echo -e "+++++++++HOSTNAME AND OTHER INFO+++++++++" >> info.txt
hostnamectl >> info.txt
echo -e "====================================" >> info.txt
echo -e "++++++++KERNEL VERSION++++++++++++" >> info.txt
uname -r >> info.txt
echo -e "====================================" >> info.txt
echo -e "++++++++++++LOGGED ON USERS+++++++++++" >> info.txt
w -u >> info.txt
echo -e "====================================" >> info.txt
echo -e "+++++++++++USERS ON THIS MACHINE++++++++++++" >> info.txt
compgen -u | sort | uniq >> info.txt
echo -e "=======================================" >> info.txt
echo -e "+++++++++++PROCESSES+++++++++++++" >> info.txt
ps aux >> info.txt
echo -e "=======================================">> info.txt
echo -e "+++++++++++++SERVICES AND CONNECTIONS++++++++++++++" >> info.txt
netstat -natup >> info.txt
echo -e "=======================================" >> info.txt
echo -e "++++++++++UPDATED FILES+++++++++++++++" >> info.txt
find /etc -type f -printf '%TY-%Tm-%Td %TT %p\n' -mtime -1 | sort -r >> info.txt
echo -e "=======================================" >> info.txt
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment