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.
sudo apt install package_name
How to Update Packages:
Keep your system up-to-date with package updates.
sudo apt update && sudo apt upgrade
sudo yum update
How to Create Users:
Create new user accounts.
sudo useradd username
How to Add Users to Groups:
Assign users to specific groups.
sudo usermod -aG groupname username
How to Change Passwords:
Change your own or another user's password.
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.
How to Copy and Move Files:
Use cp to copy files and mv to move or rename them.
cp source_file destination_directory
How to Delete Files and Directories:
Remove files and directories with rm.
How to Compress and Extract Files:
Use tar to create and extract compressed archives.
tar -czvf archive.tar.gz directory_to_compress
How to Monitor System Resources:
Check system resource usage with tools like top, htop, or free.
How to Schedule Tasks with Cron:
Automate tasks by scheduling them with the cron daemon.
crontab -e to edit the user's crontab
How to Set File Permissions:
Use chmod to change file permissions.
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.
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.