Intermediate Linux Course | TryHackMe Linux Strength Training
The post provides an in-depth walkthrough of a TryHackMe room focused on Linux Strength Training, targeting beginner to intermediate users.
Introduction
The room focuses on improving Linux command-line skills, specifically:
- File searching with
find
. - Grepping content.
- Working with encryption, decryption, and hashing.
- Exploring SQL databases.
Target Audience: Users familiar with Linux Fundamentals who want to transition to intermediate concepts.
Tasks and Key Concepts
1. File Searching Using the find
Command
- Command Breakdown:
- Search files in a directory:
find /path -type f
. - Search based on user:
find /path -user username
. - Search files of specific size:
find /path -size 52k
.
Practical Demonstrations:
- Locate a file named
readme_if_stuck.txt
find /home/dobson -type f -name "readme_if_stuck.txt"
Search for files modified on a specific date:
find /path -type f -newermt "2016-09-11" ! -newermt "2016-09-13"
Use quotes for file names with spaces.
Escape spaces in directories using backslashes (\
).
2. Reading and Searching File Content
- Using
less
: - View large files in chunks.
- Search for keywords within the file using
/keyword
.
Example:
- Search for the word “keyword” in a file:bashCopy code
less filename
/keyword
3. Moving and Renaming Files
- Command for Moving Files:
mv /source/* /destination/
Renaming Files or Folders:
- Standard renaming:
mv old_name new_name
Handling special characters (e.g., names starting with -
):
mv -- -old_name new_name
4. Transferring Files Using scp
- Transfer a file to a remote machine using SSH:
scp /path/to/file username@ip_address:/destination_path
Examples and Scenarios
Find files owned by a specific user and of a particular size:
Example: find /home/francis -type f -user francis -size 52k
.
Search for specific text in logs:
grep -irl "keyword" /home/dobson/chat_logs/
Working with modified files:
- Locate files modified between two dates:
find /home/workflows -type f -newermt "2016-09-11" ! -newermt "2016-09-13"
General Takeaways
- Command Mastery:
- The room is ideal for honing skills in navigating and manipulating Linux systems.
- Includes practical examples and hands-on tasks for real-world scenarios.
Practical Application:
- Tools like
find
,grep
, andscp
are indispensable for file management and system administration.
Next Steps:
- Dive deeper into topics like encryption, decryption, and working with SQL databases in subsequent tasks.
TryHackMe Linux Strength Training | Room Answers
Room answers can be found here.