lsof — List Open Files

lsof lists open files on a Linux or Unix system. It is useful because sockets, devices, directories and regular files can all appear as open files. Find which process is using a port List open files for a process List files opened by a user This command is helpful when troubleshooting ports, locked files, deleted … Read more

strace — Trace System Calls and Signals

strace traces system calls and signals made by a process. It is useful when a program fails but the error message does not explain what happened. Trace a command Attach to a running process Save output to a file Common things to look for are missing files, permission errors, failed network calls and repeated retries.

ltrace — Trace Library Calls in Linux

The ltrace command traces library calls made by a program. It can help when a command fails and you want to see which shared library functions it is calling. Basic usage Example Use ltrace when you are interested in library calls. Use strace when you want to trace system calls such as file, process and … Read more

gcc — GNU C Compiler Basics

gcc is the GNU C compiler. It is commonly used to compile C programs on Linux and is often required when building software from source. Compile a simple C file Run the compiled program Show warnings while compiling For larger projects, prefer the project’s documented build process, such as make, cmake or package-specific instructions.

dd — Convert and Copy Files

dd copies data at a low level. It is powerful, but it can overwrite disks if the input and output paths are wrong. Create an image of a disk or partition Write an image to a USB drive Always double-check the target device before running dd. A wrong of= value can destroy data.

Crontab Tutorial

cron runs commands on a schedule. User cron entries are edited with crontab. Edit the current user crontab Crontab format Run a script every day at 2:30 AM List existing cron jobs Use full paths inside cron jobs because the environment is usually smaller than an interactive shell.

Email Encryption with GnuPG and OpenPGP

GnuPG implements the OpenPGP standard and can be used to encrypt files or messages and to create digital signatures. It is still useful, but many older email-client instructions and key-generation examples are no longer current. Generate a modern key gpg –full-generate-key Choose a modern algorithm offered by your installed GnuPG version and protect the private … Read more