Linux How Tos

Linux common tasks and operations

Here are some Linux how-tos on common tasks and operations. Linux is a versatile operating system, and these guides should help you perform various tasks:

How to Install Software:

Use apt on Debian/Ubuntu-based systems or yum on Red Hat-based systems to install software.
Example: sudo apt install package_name

How to Update Packages:

Keep your system up-to-date with package updates.
Debian/Ubuntu: sudo apt update && sudo apt upgrade
Red Hat: sudo yum update

How to Create Users:

Create new user accounts.
Example: sudo useradd username

How to Add Users to Groups:

Assign users to specific groups.
Example: sudo usermod -aG groupname username

How to Change Passwords:

Change your own or another user's password.
Example: passwd

How to Manage Services:

Start, stop, enable, or disable services.
sudo systemctl start / stop / restart service_name

How to Navigate the File System:

Use cd to change directories, ls to list files, and pwd to print the working directory.
Example: cd /path/to/directory

How to Copy and Move Files:

Use cp to copy files and mv to move or rename them.
Example: cp source_file destination_directory

How to Delete Files and Directories:

Remove files and directories with rm.
Example: rm filename

How to Compress and Extract Files:

Use tar to create and extract compressed archives.
Example: tar -czvf archive.tar.gz directory_to_compress

How to Monitor System Resources:

Check system resource usage with tools like top, htop, or free.
Example: top

How to Schedule Tasks with Cron:

Automate tasks by scheduling them with the cron daemon.
Example: crontab -e to edit the user's crontab

How to Set File Permissions:

Use chmod to change file permissions.
Example: chmod 644 filename
(read-write for owner, read-only for others)

How to Find Files and Text:

Use find to locate files and grep to search for text within files.
Example: find /path/to/search -name filename
grep -r "search_text" /path/to/search_directory

How to Secure SSH Access:

Securely configure SSH access using SSH keys and disable password authentication.
Example: Edit SSH configuration in /etc/ssh/sshd_config.


These Linux how-tos cover a range of common tasks and should help you get started with managing a Linux system. Remember to exercise caution when running commands with administrative privileges, especially on production systems.