Devops 练习题

Liunx相关问题

1 Sample interview question:

We have a fairly large log file. Each line of the log file contains an url which a user has visited on our site. We want to figure out what's the most popular 10 urls visited by our users.

Sample logs https://raw.githubusercontent.com/elastic/examples/master/Common%20Data%20Formats/apache_logs/apache_logs

### A1:

- Use command "AWK"

- Then sort and count

```

curl log-URL | awk '{print $7}' | sort | uniq -c | sort -r| head -10

```

你可能感兴趣的:(Devops 练习题)