Shell Language

Alias

alias copy="cp"

Next time when the command "copy" is read in the shell, the command "cp" will be executed.

Grep

grep -R 'ABCD' .

Print lines that contain 'ABCD'

grep -R 'ABCD' . | grep -v 'tags'

Print lines that contain 'ABCD', and do not contain 'tags' (exclude lines that contain 'tags').

make all | grep 'ABCD'

Print all lines that are generated by make command and contain 'ABCD'

Find

find /home *.c

Find all files with ".c" name in home directory

find -name abc.c

Find the file "abc.c" in the current directory or its subdirectory

Ctag

ctags -R .

Build tags in the current directory. After that, we can use ctrl+] and ctrl+t to trace code.

Pipe & Input & Output

sign < dictionary.txt | sort | squach > gramlist.txt

Run program sign with input dictionary.txt, and then feed the output to program sort, and then feed the output to program squach, and then put the output into gramlist.txt

Reference

http://www.linuxquestions.org/questions/linux-general-1/how-to-check-linux-kernel-is-32-bit-or-64-bit-612352/ — Check 32 bits or 64 bits
http://www.panix.com/~elflord/unix/grep.html

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License