This link has been bookmarked by 406 people . It was first bookmarked on 02 Mar 2006, by Joel Liu.
-
12 Sep 14
-
09 Sep 14
-
06 Jun 14
-
06 Jan 14
-
UNIX is based upon the idea of a stream
-
Everything is a stream, or appears to be.
-
ls > /dev/null # ignore output of ls
-
# ignore output of ls
-
process stdin and send results to stdout.
-
$ ls -l | grep Aug | wc -l
-
$ apropos checksum
-
~username
-
~parrt is my home directory,
-
it is how your shell session is initialized including your ever-important CLASSPATH environment variable.
-
.bash_profile
-
644 is a common wor
-
value file
-
Translating streams
-
processes on your box in action, use top.
-
tr, sed, and awk.
-
$ cat /home/public/cs601/unix/names | tr ' ' ' '
-
tr -s ' '.
-
C file to UNIX,
-
tr -d '\r'.
-
dropping or translating single character
-
grep.
-
prints matching lines to stdout.
-
particular character sequence in a set of files.
-
$ ... | sed 's/scott//g'
-
... | sed 's/view.jsp/index.jsp/'
-
$ ... | sed 's/\(.*\).asp/\1.jsp/'
-
Be careful to enclose the expression in single quotes so the command-line expansion doesn't modify the argument.
-
$ ... | sed 's/,.*$//' # kill from comma to end of line
-
columns of data or execute a little bit of code for each line matching a pattern
-
pattern-action pairs
-
awk thinks input lines are broken up into fields (i.e., columns) separate by whitespace
-
If you omit the pattern, the action is executed for each input line.
-
Omitting the action means print the line.
-
aasghar
-
har, Ali wchen Chen, Wei zchen Chen, Zhen-Jian
-
cat /home/public/cs601/unix/emails.txt | \ awk '{printf("%s %s ", $3, $2);}' | \ tr -d ','
-
where END is a special pattern that means "after processing the stream."
-
sort | \ uniq
-
tar cvf /tmp/parrt.backup.tar parrt
-
tar untars things in the current directory!
-
-
11 Oct 12
-
01 May 12
-
24 Nov 11
-
25 Aug 11
-
01 Jul 11
-
22 Jun 11
-
17 May 11
-
The \(...\) grouping collects text that you can refer to with \1.
-
-
01 Jan 11
-
12 Oct 10
-
13 Sep 10
-
31 Aug 10
-
22 Jun 10
-
29 Apr 10
-
06 Apr 10
-
26 Mar 10
-
06 Feb 10
-
03 Feb 10
-
20 Jan 10
-
08 Dec 09
-
17 Nov 09
-
27 Oct 09
-
15 Oct 09
-
01 Oct 09
-
09 Sep 09
-
08 Sep 09
-
08 Aug 09
-
30 Jul 09
-
28 Jul 09
-
03 Apr 09
-
27 Feb 09
-
07 Jan 09
-
24 Nov 08
-
22 Nov 08
-
15 Nov 08
-
07 Nov 08
-
06 Nov 08
-
08 Sep 08
-
19 Aug 08
-
10 Jun 08
-
14 May 08
-
03 Apr 08
-
10 Mar 08
-
28 Feb 08
Travis Taylorystem, processing log files, and generally automating as much as possible.
If you want to be a serious server developer, you will need to have a certain facility with a number of UNIX tools; about 15. You will start to see similarities among them, partic -
08 Jan 08
-
20 Dec 07
-
14 Dec 07
-
03 Dec 07
-
26 Nov 07
-
22 Nov 07
-
08 Oct 07
-
04 Oct 07
-
29 Aug 07
-
27 Aug 07
-
13 Aug 07
-
10 Jul 07
-
30 Jun 07
viniciusjlIf you want to be a serious server developer, you will need to have a certain facility with a number of UNIX tools; about 15. You will start to see similarities among them, particularly regular expressions, and soon you will feel very comfortable. Combini
linux hacker admin tips reference tutorial howto shell for:tcristino for:mcide67 for:gnustavo for:exadmax for:andreyev_br for:andersondesalve
-
29 Jun 07
-
16 Jun 07
-
23 May 07
-
20 Apr 07
-
13 Apr 07
-
26 Mar 07
-
12 Feb 07
-
04 Feb 07
-
27 Jan 07
-
25 Jan 07
-
10 Jan 07
-
22 Dec 06
-
04 Dec 06
Paul Terry WalhusWhen you need to work with columns of data or execute a little bit of code for each line matching a pattern, use awk. awk programs are pattern-action pairs. While some awk programs are complicated enough to require a separate file containing the program,
-
24 Nov 06
-
21 Nov 06
Forrest Cao$ ls -l | grep Aug | wc -l # line count$ apropos checksum # help search$ grep -v '/images' # -v ignore$ tr -d '\r' # To convert a PC file to UNIX$ ... | sed 's/,.*$//' # kill from comma to end of line$ awk '{n+=$1;} ; END {print n;}' < /home/public/cs6
-
19 Nov 06
-
07 Nov 06
-
03 Nov 06
-
28 Oct 06
-
27 Oct 06
-
26 Oct 06
-
-
How To Look Like A UNIX Guru
-
-
25 Oct 06
-
23 Oct 06
-
21 Oct 06
-
16 Oct 06
-
14 Oct 06
-
13 Oct 06
-
12 Oct 06
-
11 Oct 06
Page Comments
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.