Back to commands

Hosting Operations

Read-only, can be slow

Show Nginx Include Lines

You need to see which files the main Nginx config is expected to include.

Command

grep -RInE '^[[:space:]]*include[[:space:]]' fixtures/nginx/nginx.conf fixtures/nginx/conf.d fixtures/nginx/sites-enabled

Before you run this

System impact: Read-only. Can create load on large logs, directories, filesystems, or process tables.

When not to use it: Do not assume every include glob matches files; inspect the target path when output looks suspicious.

Expected output

Include directives with config paths and line numbers.

System impact

Read-only, can be slow. Nothing changes. The command searches for include directives.

Scope this to the smallest useful path or service on busy systems.

Recovery / rollback: no state is changed.

When to use it

Use when an edited config file appears to be ignored.

When not to use it

Do not assume every include glob matches files; inspect the target path when output looks suspicious.

Watch this command run

Command transcript

This sanitized transcript shows the commands and output shape without exposing host details.

demo@lab:~$

$ cat sample-files/nginx/nginx.conf

events {}
http {
  include conf.d/*.conf;
  include sites-enabled/*;
}

$ grep -RInE '^[[:space:]]*include[[:space:]]' sample-files/nginx/nginx.conf sample-files/nginx/conf.d sample-files/nginx/sites-enabled

sample-files/nginx/nginx.conf:3:  include conf.d/*.conf;
sample-files/nginx/nginx.conf:4:  include sites-enabled/*;

$ find sample-files/nginx -maxdepth 3 -type f | sort

sample-files/nginx/conf.d/admin.conf
sample-files/nginx/nginx.conf
sample-files/nginx/sites-enabled/example.conf
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  1. cat fixtures/nginx/nginx.conf
  2. grep -RInE '^[[:space:]]*include[[:space:]]' fixtures/nginx/nginx.conf fixtures/nginx/conf.d fixtures/nginx/sites-enabled
  3. find fixtures/nginx -maxdepth 3 -type f | sort

next steps

Related commands

Hosting Operations Can be slow

List Nginx Listen Directives

The site was configured, but the port was not.

grep -RInE '^[[:space:]]*listen[[:space:]]' fixtures/nginx/conf.d fixtures/nginx/sites-enabled
Hosting Operations Can be slow

Map Nginx Roots and Aliases

The URL was right. The filesystem path was not.

grep -RInE '^[[:space:]]*(root|alias)[[:space:]]' fixtures/nginx/conf.d fixtures/nginx/sites-enabled
Hosting Operations Can be slow

Map Nginx Proxy Targets

Nginx was healthy. It was proxying to the wrong place.

grep -RInE '^[[:space:]]*proxy_pass[[:space:]]' fixtures/nginx/conf.d fixtures/nginx/sites-enabled
Hosting Operations Can be slow

Find the Nginx Default Server

The wrong site answered because it was the fallback.

grep -RIn 'default_server' fixtures/nginx/conf.d fixtures/nginx/sites-enabled
Hosting Operations Can be slow

Find Apache Document Roots

Apache was serving files from a different directory than expected.

grep -RInE '^[[:space:]]*DocumentRoot[[:space:]]' fixtures/apache/sites-enabled
Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • lpic1:103-gnu-unix-commands
  • lfcs:essential-commands
  • lfcs:operations-deployment
  • lfcs:services-logs
  • linuxplus:automation-scripting
  • linuxplus:provisional
  • risk:read-only

Useful for

  • LPIC-1 style command-line practice
  • LFCS style performance tasks
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.