Linux – information gathering (part 1)

2017-04-03 von Mario

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.

uname -A
cat /proc/version
dmesg | grep Linux

Under Redhat you can use this command.

rpm -q kernel

Distribution

Find release information on Debian systems

cat /etc/lsb-release

and under Redhat systems use

cat /etc/redhat-release

Environmental Variables

In the following config files, you can read system wide environmental variables about the user’s shells.

sudo cat /etc/profile
sudo cat /etc/bash.bashrc

In your home directory, environmental variables are set as well.

cat ~/.bash_profile

In the file “bashrc” contains commands, aliases and functions from user’s bash.

cat ~/.bashrc

This file is read and executed every time a login shell exits.

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.

env

The command “set” shows the system variables with the corresponding contents.

set

Services

Print all processes with the owner’s user name.

ps aux

The command “top” display Linux processes.

top

Applications

The following commands list all installed applications.

ls -alh /usr/bin/
ls -alh /sbin/
dpkg -l
rpm -qa

Job Scheduler

Lists all jobs form the current user’s scheduler.

crontab -l

This command gives a detailed view for all defined jobs.

ls -al /etc/cron*

Previous parts

Linux – information gathering (part 1)

Linux – information gathering (part 2)

Linux – information gathering (part 3)

 

Thx @Programming Wolf

Kategorie: IT-Security Schlagwörter: