Do the following:
grep -rnw '/path/to/somewhere/' -e "pattern"
-r or -R is recursive, -n is line number and -w stands match the whole word. -l (lower-case L) can be added to just give the file name of matching files.
#!/usr/bin/env bash | |
sudo su - | |
mkdir /etc/ssl | |
mkdir /etc/ssl/certs | |
mkdir /etc/ssl/private | |
chmod 755 /etc/ssl | |
chmod 755 /etc/ssl/certs |
upstream jenkins { | |
server 127.0.0.1:8080 fail_timeout=0; | |
} | |
server { | |
listen 80; | |
# server_name jenkins.domain.tld; | |
return 301 https://$host$request_uri; | |
} |
# method 1 | |
$ echo $(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}') | |
# method 2 | |
$ echo $(ip -o -4 addr list eth0 | perl -n -e 'if (m{inet\s([\d\.]+)\/\d+\s}xms) { print $1 }') |
# local instance | |
ssh-keygen -b 2048 -P '' -f ~/.ssh/id_rsa | |
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys | |
# remote instance | |
ssh-copy-id -i ~/.ssh/id_rsa.pub 192.168.1.1 | |
# more: https://www.digitalocean.com/community/tutorials/how-to-use-ssh-to-connect-to-a-remote-server-in-ubuntu |
#!/usr/bin/env python | |
""" | |
Basic script to create an empty python package containing one module | |
""" | |
from skeleton import Skeleton, Var | |
class BasicModule(Skeleton): | |
""" | |
Create an empty module with its etup script and a README file. |
Windows command | Unix command | Notes |
---|---|---|
set | env | Set on Windows prints a list of all environment variables. For individual environment variables, set is the same as echo $ on Unix. |
set Path | export $PATH | Print the value of the environment variable using set in Windows. |
set PROJ | -- | result: PROJ=c:\project |
echo %PROJ% | echo $PROJ | result: c:\project |
|