Command Line Hints

Knowledge Base Entry: #128
^Top
<< Back
Mobile-Menu










Command Line Hints
Category: Linux/Commands
Author: Bugfish
Created at: 2021-03-08 17:22:19
Modified at: 2025-09-20 03:44:10
Directs Hits: 755

Find a String inside Files

grep -rnw '/path/to/somewhere/' -e 'pattern'

Find File in Folder Structure
find ./ -name card.php

Display Linux System Informations

uname

Display Kernel Releases Informations

uname -r

Display Systems uptime and load average

uptime

Show the systems hostname

hostname

Display IP-Adress of System

hostname -i

Show System Reboot History

last reboot

Display current date and time

date

Change or Query the system Clock

timedatectl

Display the current Calender Month and Day

cal

Display current logged in Users to the System

w

Display Informations about user who you are logged in as

whoami

Display Informations about a user

finger USERNAMEHERE

Change the current work directory

cd

See Bootup Messages

dmesg

Display informations about CPU

cat /proc/cpuinfo

Display Informations about Memory

cat /proc/meminfo

Display Informations about System Hardware Configuration

lshw

Display Block Devices Related Informations

lsblk

Display free and used Memory on the System (-m for MB)

free -m

Display PCI Devices in Diagram

lspsi -tv

Display USB Devices in Diagram

lsusb-tv

Display Hardware informations from BIOS

dmidecode

Display Informations about disk data (select right device)

hdparm -i /dev/xda

Start read speed test on device XDA

hdparm -tT /dev/xda

Test for corrupted Blocks on Disk

badblocks -s /dev/xda

Show Active Processs

ps

Searches for the ID of Process 'telnet'

ps aux | grep telnet

Displays Memory Map of Processes

pmap

Display all running processes like a task manager

top

Terminate a Process with an ID

kill IDHERE

Kill a processes named apache2

killall apache2

Visualize Processes in a Tree

pstree

Display Free Space on Mounted Systems

df -h

Display Free Inodes on Filesystems

df -i

Show Disk Partitions, sizes and types

fdisk -l

Display disk usage in the current directory in human readable format

du -sh

Display Details of the active user

id

Show the last login in the system

last

Show who is logged into the system now

who

Add the group admin

groupadd admin

Add the user sam

adduser sam

Deletes the user sam

deluser sam

Caution: I do not guarantee the reliability of the information given here, the code described on this page is executed at your own risk and in the event of damage or other unforeseeable consequences I am in no way responsible or liable.
This Website is using Session Cookies for Site Functionality.