# Useful Linux commands

1. Login   \
   web - admin   \
   SSH - root   \
   Password: Rasp4icu
2. Read the log

```sh
logread | grep poll_api
```

3. Print log in realtime

```sh
logread -f | grep poll_api
```

4. Empty log

```sh
logread -c
```

5. Make the file executable

```sh
chmod +x /usr/bin/poll_api.sh
```

6. Restart

```sh
reboot
```

7. Check for hidden extensions like .sh.txt:

```sh
ls -la /usr/bin/ | grep poll
```

8. If you see ^M at the ends of lines, it's using Windows line endings — and the fix below will resolve it.

```sh
cat -A /usr/bin/poll_api.sh
```

9. If there’s a syntax error early in the file, it might prevent execution. Try running:

```sh
sh /usr/bin/poll_api.sh
```

If this works, the file is fine but might be missing the #!/bin/sh line.

10. Remove extra characters    \
    Run this command to clean the file:

```sh
sed -i 's/\r$//' /usr/bin/poll_api.sh
```
