Monday, October 08, 2007

[Unix] Frequently Used Commands

grep

grep foo file
print the lines containing the pattern foo in file
ls | grep foo
print the lines from STDIN containing the pattern foo
grep -r -e 'PATTERN' ./user *.txt
Find a pattern PATTERN in all txt files, recursively search for all sub directories of directory "./user"

xrdb

xrdb RESOURCE_FILE
Load the resource file for X windows (e.g. xterm). The default resource file is ".Xdefaults"

top

top
Check the computer resource usage.

ln

ln -s
Check the computer resource usage.

find

find . -name "abcd*"
Find a file with "abcd" as part of the filename in current directory or the sub directories

No comments: