π Day 9 β Linux Fundamentals Part 1
π― Goal
Get comfortable navigating and interrogating a Linux system using core terminal commands, instead of blindly copy-pasting.
β What I Did
-
Completed TryHackMe β Linux Fundamentals Part 1
π https://tryhackme.com/room/linuxfundamentalspart1 -
Practiced essential Linux commands:
-
User identification
-
File and directory navigation
-
File content inspection
-
Searching files and strings
-
Basic shell operators
-
-
Made deliberate mistakes (wrong paths, wrong grep syntax) and corrected them by inspecting the filesystem instead of guessing.
π§ͺ Commands Practiced
Identity & Output
| Command | Purpose |
|---|---|
whoami |
Show current logged-in user |
echo |
Output text to stdout |
tryhackme@linux1:~$ whoami
Navigation & File Discovery
| Command | Full Name |
|---|---|
ls |
list |
cd |
change directory |
pwd |
print working directory |
cat |
concatenate |
ls cd Pictures pwd
- Learned that directory names with spaces require quotes:
ls "Important Files"
Viewing File Contents
-
Used
catto read text files directly -
Understood why dumping large files blindly is a bad idea (future:
less,head,tail)
Finding Files
- Located files by name:
find -name passwords.txt
- Used wildcards:
find -name "*.txt"
Searching File Contents with grep
- Searched logs for specific strings:
grep 'THM' access.log
- Learned correct vs incorrect syntax:
βgrep THM* access.log
βgrep 'THM' access.log
Recursive Searching
- Searched across directories:
grep -R 'THM' /home/tryhackme/
π§ Shell Operators Learned
| Operator | Meaning |
|---|---|
& |
Run command in background |
&& |
Run second command only if first succeeds |
> |
Redirect output (overwrite) |
>> |
Redirect output (append) |
Examples:
command1 && command2 echo "log" > file.txt echo "more" >> file.txt
β What Worked
-
Navigating directories logically instead of guessing paths
-
Using
lsbeforecd(basic, but critical) -
Understanding why grep failed instead of retrying randomly
-
Seeing how small commands chain together into real workflows
β What Didnβt
-
Initial misuse of
grepwildcards -
Attempting to
cdinto directories without confirming they exist -
Underestimating how strict Linux is with syntax
π§ Key Takeaways
-
Linux doesnβt forgive assumptions β inspect first
-
Wildcards are powerful but dangerous if misunderstood
-
grepis foundational for log analysis and forensics -
Command-line literacy is non-negotiable in cybersecurity
β Questions
-
When should
grepbe combined with other tools (awk,sed)? -
What are safe ways to inspect very large files?
-
At what point does scripting replace manual command chains?
π One-Sentence Summary
Linux becomes manageable the moment you stop guessing and start interrogating the system methodically.
