awk / sed
awk
# print 2nd parameter from output for each line
history | awk '{print $2}'
# find 20 most used commands
# * sort: sort output
# * uniq -c: count unique lines
# * sort -n: sort by line count numerical
# * tail: show last 20 results
history | awk '{print $2}' | sort | uniq -c | sort -n | tail -n 20sed
# replace string in file, "-i" updated the file in place
sed -i 's/old_string/new_string/g' input.txt
# find string in all files in the current directory and
# replace it in the output with a new string
grep -ri "old_string" . | sed 's/old_string/new_string/g'Last updated