User Tools

Site Tools


shell

Shell

Process Every File in Directory

find /some/directory -maxdepth 1 -type f -exec cmd option {} \; > results.out

Find File by Content

find . -type f -name "*.java" -print | xargs grep "window"

Display Specific Column from Text

cat * | awk '{print $2}'

List all open ports for one process

netstat -anp46 | grep LISTEN | grep <processid>

Redirect stderr and stdout

test.sh &> /tmp/log
shell.txt · Last modified: 2015/10/21 09:24 by mihael