General Purpose Unix Commands

Posted by admin on February 8, 2008 under Programming | Comments are off for this article


Computer

Clear terminal

cls, clear, tput clear

Concatenating files

cat

Splitting Files

split

Numbering lines

nl, cat -n

Zipping file, unzipping files

gzip, gunzip

Converting files in hexadecimal

od

Remove nonprintable characters

tr, strings, col -b

Formats, Word wrapping

fold, nroff, troff

Outputting a part of file: say first 5 lines, last 5 lines, lines from 10 to 16

head, tail, sed

Counting words, lines

wc

Sorting text

sort

Removing duplicate lines,words

Sed, uniq

Comparing 2 files line/line

diff

Find Replace

sed, perl, awk

Changing case : uppercase letters to lowercase and vice versa

tr

Matching braces

(% in vi)

Converting tabs to spaces and vice versa

expand, unexpand

Updating file timestamp

touch

View folder list

tree

Comments are closed.