> For the complete documentation index, see [llms.txt](https://42-guide.gitbook.io/42-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://42-guide.gitbook.io/42-guide/piscine-life/shell00/oh-yeah-mooreeee.md).

# Oh yeah, mooreeee

Objective: The goal is to create files and directories with specific permissions, sizes, and timestamps so that `ls -l` matches the given output. Here's what you need to do:

***

#### **Step 1: Understand the `ls -l` Format**

The `ls -l` output shows:

```
drwxrwxrwx 2 user group size date time name
```

* **First character**: `d` = directory, `-` = file, `l` = symbolic link.
* **Permissions**: Split into three sets (owner, group, others). Each set has `r` (read), `w` (write), `x` (execute).
* **Links**: Number of hard links.
* **Size**: In bytes.
* **Timestamp**: Modification time.

***

#### **Step 2: Create Files and Directories**

**1. test0 (Directory)**

* Command:sh

  ```bash
  mkdir test0
  chmod 551 test0  # Permissions: r-x--xr-x
  ```

**2. test1 (File)**

* Command:

  ```bash
  touch test1
  chmod 714 test1  # Permissions: rwx--xr--
  echo -n "1234" > test1  # Size = 4 bytes
  ```

**3. test2 (Directory)**

* Command:

  ```bash
  mkdir test2
  chmod 114 test2  # Permissions: --x--r--
  ```

**4. test3 (File)**

* Command:

  ```bash
  touch test3
  chmod 440 test3  # Permissions: r--r--
  echo -n "1" > test3  # Size = 1 byte
  ```

**5. test4 (File)**

* Command:

  ```bash
  touch test4
  chmod 441 test4  # Permissions: r--r--x
  echo -n "12" > test4  # Size = 2 bytes
  ```

**6. test5 (Hard Link to test3)**

* Command:

  ```bash
  ln test3 test5  # Creates a hard link (link count = 2)
  ```

**7. test6 (Symbolic Link to test0)**

* Command:

  ```bash
  ln -s test0 test6  # Creates a symbolic link
  ```

***

#### **Step 4: Set Timestamps**

Use `touch -t` to set timestamps (optional, as the problem accepts a year instead of exact time):

```bash
touch -t 202306012047 test0  # Jun 1 20:47
touch -t 202306012146 test1  # Jun 1 21:46
# Repeat for other files/dirs...
```

***

#### **Step 5: Verify Output**

Run `ls -l` to check permissions, sizes, and timestamps. Ignore `XX` values (user, group, etc.).

***

#### **Step 6: Create the Tarball**

```bash
tar -cf exo2.tar *
```

***

#### **Key Commands to Remember**

* `chmod`: Change permissions (e.g., `chmod 755 file`).
* `ln`: Create hard/symbolic links.
* `touch -t`: Set timestamps.
* `tar`: Create archives.

***

#### **Useful Resources**

* [Linux File Permissions Explained](https://linuxize.com/post/understanding-linux-file-permissions/)
* [Tar Command Guide](https://www.gnu.org/software/tar/manual/tar.html)

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://42-guide.gitbook.io/42-guide/piscine-life/shell00/oh-yeah-mooreeee.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
