Capture both streams linux
Redirect stdout+stderr to file and screen simultaneously
command 2>&1 | tee /tmp/all.log
more linux
all 133 commands →
Replace string in files recursively
grep -rl 'old_string' /etc/ | xargs sed -i 's/old_string/new_string/g'
Print specific columns with awk
awk '{print $1, $3}' /etc/passwd
Sum a column with awk
awk '{sum += $2} END {print sum}' file.txt
Delete lines matching pattern
sed -i '/^#/d' config.conf
Multi-line sed replacement
sed -n '/START/,/END/p' file.txt