You have just logged into your Linux system and need to navigate through the filesystem to find a specific file named treasure_map.txt
.
- Print the current working directory.
- List the contents of the current directory.
- Change to the
/home
directory. - List the contents of the
/home
directory. - Find the file
treasure_map.txt
and print its location.
1. Print the current working directory:
```bash
pwd
- List the contents of the current directory:
ls
- Change to the
/home
directory:cd /home
- List the contents of the
/home
directory:ls
- Find the file
treasure_map.txt
and print its location:find /home -name treasure_map.txt
## Project 2: Managing Files and Directories
### Scenario:
You need to organize your files and directories for a research project. This involves creating directories, moving files, and deleting unnecessary files.
### Challenge:
1. Create a directory named `research`.
2. Move into the `research` directory.
3. Create an empty file named `notes.txt`.
4. Create a subdirectory named `data`.
5. Move `notes.txt` into the `data` subdirectory.
6. Delete the `notes.txt` file from the `data` subdirectory.
### Hint:
- Create a directory named
research
:mkdir research
- Move into the
research
directory:cd research
- Create an empty file named
notes.txt
:touch notes.txt
- Create a subdirectory named
data
:mkdir data
- Move
notes.txt
into thedata
subdirectory:mv notes.txt data/
- Delete the
notes.txt
file from thedata
subdirectory:rm data/notes.txt
## Project 3: Viewing and Editing Files
### Scenario:
You have a file named `artifact_info.txt` containing important information about discovered artifacts. You need to view and edit this file using basic Linux commands.
### Challenge:
1. View the contents of the file `artifact_info.txt`.
2. Append the text "New artifact discovered" to the file.
3. Display the last 5 lines of the file.
4. Count the number of lines in the file.
### Hint:
- View the contents of the file
artifact_info.txt
:cat artifact_info.txt
- Append the text "New artifact discovered" to the file:
echo "New artifact discovered" >> artifact_info.txt
- Display the last 5 lines of the file:
tail -n 5 artifact_info.txt
- Count the number of lines in the file:
wc -l artifact_info.txt
## Project 4: Managing Processes
### Scenario:
Your system is running several processes, and you need to monitor and manage these processes to ensure optimal performance.
### Challenge:
1. Display a list of all running processes.
2. Find the process ID (PID) of a process named `research_daemon`.
3. Kill the process `research_daemon` using its PID.
4. Verify that the process has been terminated.
### Hint:
- Display a list of all running processes:
ps aux
- Find the process ID (PID) of a process named
research_daemon
:pgrep research_daemon
- Kill the process
research_daemon
using its PID (replace<PID>
with the actual PID):kill <PID>
- Verify that the process has been terminated:
pgrep research_daemon
## Project 5: Using Basic Networking Commands
### Scenario:
You need to troubleshoot network connectivity issues on your Linux system by using basic networking commands.
### Challenge:
1. Display the IP address of your system.
2. Display the network interfaces on your system.
3. Ping the website `www.example.com` to check connectivity.
4. Display the routing table.
### Hint:
- Display the IP address of your system:
ifconfig
- Display the network interfaces on your system:
ip link show
- Ping the website
www.example.com
to check connectivity:ping www.example.com
- Display the routing table:
netstat -rn
---
These exercises will provide you with practical experience using basic Linux commands and help you develop a solid understanding of fundamental Linux operations.