Skip to content

Instantly share code, notes, and snippets.

@chrisyeung1121
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisyeung1121/3275f47f02e1953ed11a to your computer and use it in GitHub Desktop.
Save chrisyeung1121/3275f47f02e1953ed11a to your computer and use it in GitHub Desktop.
linux command cheat sheet
# Check netstat
netstat -anp tcp
# List which apps are using port 5000
lsof -i :5000
# Check brew package info
brew info elasticsearch
# To start elasticsearch without launctl
elasticsearch --config=/usr/local/opt/elasticsearch/config/elasticsearch.yml
# Find the most recently changed file within a directory
## http://askubuntu.com/questions/61179/find-the-latest-file-by-modified-date
find . -type f -exec ls -lt \{\} \+ | head
```
-rw-r--r-- 1 chrisyeung staff 899 Apr 17 00:58 ./db/schema.rb
-rw-r--r-- 1 chrisyeung staff 11740499 Apr 17 00:58 ./log/development.log
-rw-r--r-- 1 chrisyeung staff 4336 Apr 17 00:57 ./Gemfile.lock
-rw-r--r-- 1 chrisyeung staff 352 Apr 17 00:57 ./Gemfile
-rw-r--r-- 1 chrisyeung staff 237 Apr 17 00:55 ./config/database.yml
-rw-r--r-- 1 chrisyeung staff 472 Apr 16 23:34 ./tmp/cache/assets/development/sprockets/v3.0/3K2piOKDNTrVCWkh5JZnKIk7dEMp4A5onSlyHksKh7k.cache
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment