🐧 Day 4/30 — #Linux
Files are the building blocks of every Linux system.
Whether you're writing code, managing servers, or working with configuration files, you'll constantly create, copy, move, and delete files.
Managing Files in Linux – Create, Copy, Move, and Remove
Linux provides powerful commands for handling files directly from the terminal.
The most important file management commands are:
→ touch — Create a new file
→ cp — Copy files and directories
→ mv — Move or rename files and directories
→ rm — Remove files and directories
Examples:
→ touch notes.txt
Creates an empty file called notes.txt.
→ cp notes.txt backup.txt
Creates a copy of notes.txt named backup.txt.
→ mv notes.txt Documents/
Moves notes.txt to the Documents directory.
→ mv oldname.txt newname.txt
Renames a file.
→ rm notes.txt
Deletes a file permanently.
→ rm -r project/
Deletes a directory and all its contents.
Important Warning ⚠️
Linux does not have a recycle bin when using the rm command.
Once a file is removed, recovery can be difficult or impossible.
Why This Matters:
→ Organize projects efficiently
→ Manage application files
→ Automate workflows with scripts
→ Maintain server directories
→ Build confidence using the Linux terminal
Learning these commands is essential because file management is a daily task for developers, system administrators, and DevOps engineers.
🐧 Grab the Linux Ebook: https://t.co/DeHjJ1Wubf
𝗗𝗮𝘆 𝟭𝟬/𝟲𝟬 𝗼𝗳 𝗦𝗤𝗟 𝗦𝗲𝗿𝗶𝗲𝘀 — 𝗣𝗮𝘁𝘁𝗲𝗿𝗻 𝗠𝗮𝘁𝗰𝗵𝗶𝗻𝗴 – 𝗟𝗜𝗞𝗘, 𝗜𝗟𝗜𝗞𝗘, 𝗮𝗻𝗱 𝗪𝗶𝗹𝗱𝗰𝗮𝗿𝗱𝘀
Sometimes you don't know the exact value you're searching for in a database.
Instead of matching exact values, SQL allows you to search for patterns within text using LIKE, ILIKE, and wildcard characters.
Today’s lesson covers how to perform flexible text searches in SQL 👇
1️⃣ 𝗪𝗵𝗮𝘁 𝗶𝘀 𝗽𝗮𝘁𝘁𝗲𝗿𝗻 𝗺𝗮𝘁𝗰𝗵𝗶𝗻𝗴?
Pattern matching allows you to find rows where text values follow a specific pattern rather than requiring an exact match.
Example:
SELECT * FROM users
WHERE name LIKE 'J%';
2️⃣ 𝗧𝗵𝗲 𝗟𝗜𝗞𝗘 𝗼𝗽𝗲𝗿𝗮𝘁𝗼𝗿
LIKE is used to search for specified patterns in text columns.
Example:
SELECT * FROM products
WHERE product_name LIKE 'Phone%';
3️⃣ 𝗧𝗵𝗲 % 𝘄𝗶𝗹𝗱𝗰𝗮𝗿𝗱
The percent sign (%) represents zero, one, or multiple characters.
Example:
SELECT * FROM users
WHERE email LIKE '%https://t.co/8ByxpXKf8t';
4️⃣ 𝗦𝘁𝗮𝗿𝘁𝘀 𝘄𝗶𝘁𝗵 𝗮 𝘃𝗮𝗹𝘂𝗲
Use % at the end of a pattern to find values that begin with specific text.
Example:
SELECT * FROM customers
WHERE name LIKE 'Sam%';
5️⃣ 𝗘𝗻𝗱𝘀 𝘄𝗶𝘁𝗵 𝗮 𝘃𝗮𝗹𝘂𝗲
Use % at the beginning of a pattern to find values that end with specific text.
Example:
SELECT * FROM files
WHERE filename LIKE '%.pdf';
6️⃣ 𝗖𝗼𝗻𝘁𝗮𝗶𝗻𝘀 𝘁𝗲𝘅𝘁
Place % on both sides of a value to find text appearing anywhere within a string.
Example:
SELECT * FROM articles
WHERE title LIKE '%SQL%';
7️⃣ 𝗧𝗵𝗲 _ 𝘄𝗶𝗹𝗱𝗰𝗮𝗿𝗱
The underscore (_) represents exactly one character.
Example:
SELECT * FROM users
WHERE code LIKE 'A_1';
8️⃣ 𝗧𝗵𝗲 𝗜𝗟𝗜𝗞𝗘 𝗼𝗽𝗲𝗿𝗮𝘁𝗼𝗿
ILIKE performs case-insensitive pattern matching in databases such as PostgreSQL.
Example:
SELECT * FROM users
WHERE name ILIKE 'john%';
9️⃣ 𝗣𝗮𝘁𝘁𝗲𝗿𝗻 𝗺𝗮𝘁𝗰𝗵𝗶𝗻𝗴 𝗶𝘀 𝘄𝗶𝗱𝗲𝗹𝘆 𝘂𝘀𝗲𝗱
Search bars, user directories, product catalogs, and filtering systems often rely on LIKE queries.
🔟 𝗠𝗮𝘀𝘁𝗲𝗿𝗶𝗻𝗴 𝘄𝗶𝗹𝗱𝗰𝗮𝗿𝗱𝘀 𝗶𝗺𝗽𝗿𝗼𝘃𝗲𝘀 𝘀𝗲𝗮𝗿𝗰𝗵𝗶𝗻𝗴
Understanding how wildcards work helps you build flexible and user-friendly database queries.
💡 𝗞𝗲𝘆 𝘁𝗮𝗸𝗲𝗮𝘄𝗮𝘆:
LIKE and ILIKE allow SQL to search for patterns instead of exact values.
Combining wildcard characters with pattern matching gives you powerful tools for building dynamic search functionality.
Grab SQL Playbook: https://t.co/0bRVxTZBbK
Which wildcard do you use most often: % or _ ?
🔵SOC Analyst
The 24/7 first responder of cyber security, monitors alerts and investigates threats in real time. Their job is to detect breaches before they become disasters.
🔴Pen Tester
A professional hacker hired to break in before the bad guys do. They simulate real attacks to expose vulnerabilities, legally.
🟣Network & SecurityEngineer
Builds and maintains the defensive infrastructure, firewalls, VPNs, and secure network architecture. They keep the pipes safe and the traffic clean.
🟡Security Architect
Designs the entire security blueprint of an organisation's systems. They think in systems, not just solutions, connecting dots across cloud, On-premises, and code.
Found one of the most underrated DevOps learning repos on GitHub 🤯
Most people try to learn DevOps by jumping between random YouTube videos, blog posts, and outdated tutorials.
This repo puts everything in one place.
- Linux.
- Docker.
- Kubernetes.
- Terraform.
- AWS.
- CI/CD.
- Monitoring.
- Networking.
- GitOps.
And a lot more.
Basically a curated roadmap of free resources for anyone trying to get into DevOps or level up their skills.
Definitely worth starring ⭐
Repo: https://t.co/czH0YNXL78