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
```
网友评论