Skip to content

Instantly share code, notes, and snippets.

@alkarem34
Created March 13, 2021 14:06
Show Gist options
  • Save alkarem34/2f9eca5748b303491894a002a7df737b to your computer and use it in GitHub Desktop.
Save alkarem34/2f9eca5748b303491894a002a7df737b to your computer and use it in GitHub Desktop.
Fetch system info in one line
# replace the pacman command with your distros package manager
# without colors
echo -e "$USER@`hostname`\nos `lsb_release -ds|tr -d '"'`\nkern `uname -sr`\npkgs `pacman -Qq|wc -l`\nsh $SHELL\nup `uptime -p|sed 's/^.\{3\}//'`\nfree `/bin/free -tm|awk 'NR==2{print $2"MB / "$3"MB"}'`"
# with colors
echo -e "\033[0;36m$USER@`hostname`\n\033[0;34mos \033[0;37m`lsb_release -ds|tr -d '"'`\n\033[0;34mkern \033[0;37m`uname -sr`\n\033[0;34mpkgs \033[0;37m`pacman -Qq|wc -l`\n\033[0;34msh \033[0;37m$SHELL\n\033[0;34mup \033[0;37m`uptime -p|sed 's/^.\{3\}//'`\n\033[0;34mfree \033[0;37m`/bin/free -tm|awk 'NR==2{print$2"MB / "$3"MB"}'`"
@alkarem34
Copy link
Author

alkarem34 commented Mar 22, 2021

echo -e "\033[0;36m$USER@`hostname`\n\033[0;34mos \033[0;37m`lsb_release -ds|tr -d '"'`\n\033[0;34mkern \033[0;37m`uname -sr`\n\033[0;34mpkgs \033[0;37m`pacman -Qq | wc -l`\n\033[0;34msh \033[0;37m$SHELL\n\033[0;34mup \033[0;37m`uptime -p|sed 's/^.\{3\}//'`\n\033[0;34mfree \033[0;37m`/bin/free -tm|awk 'NR==2{print $2"MB / "$3"MB"}'`\n\033[0;34mwm \033[0;37m`grep -n exec $HOME/.xinitrc | cut -d ' ' -f 2 | tail -n 1`"

with window manager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment