Linux – information gathering (part 1)
Sometimes you need a very fast overview over a current Linux system. In this case, the next commands can be very helpful.
System
With the following commands, you get information about the kernel.
1 2 3 | uname -A cat /proc/version dmesg | grep Linux |
Under Redhat you can use this command.
1 | rpm -q kernel |
Distribution
Find release information on Debian systems
1 | cat /etc/lsb-release |
and under Redhat systems use
1 | cat /etc/redhat-release |
Environmental Variables
In the following config files, you can read system wide environmental variables about the user’s shells.
1 2 | sudo cat /etc/profile sudo cat /etc/bash.bashrc |
In your home directory, environmental variables are set as well.
1 | cat ~/.bash_profile |
In the file “bashrc” contains commands, aliases and functions from user’s bash.
1 | cat ~/.bashrc |
This file is read and executed every time a login shell exits.
1 | cat ~/.bash_logout |
env is a shell command for Unix and Unix-like operating systems. The command “env” is used to print a list of environment variables.
1 | env |
The command “set” shows the system variables with the corresponding contents.
1 | set |
Services
Print all processes with the owner’s user name.
1 | ps aux |
The command “top” display Linux processes.
1 | top |
Applications
The following commands list all installed applications.
1 2 3 4 | ls -alh /usr/bin/ ls -alh /sbin/ dpkg -l rpm -qa |
Job Scheduler
Lists all jobs form the current user’s scheduler.
1 | crontab -l |
This command gives a detailed view for all defined jobs.
1 | ls -al /etc/cron* |
Previous parts
Linux – information gathering (part 1)
Linux – information gathering (part 2)
Linux – information gathering (part 3)
Thx @Programming Wolf