Math-Tuttle-OSX:~ smtuttle$ cd humboldt/f12cs279/279labs/279lab09
Math-Tuttle-OSX:279lab09 smtuttle$ find
usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]
find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]
Math-Tuttle-OSX:279lab09 smtuttle$ !ssh
ssh st10@nrs-labs.humboldt.edu
st10@nrs-labs.humboldt.edu's password:
Last login: Wed Oct 17 13:21:43 2012 from 137.150.7.22
-bash: /usr/local/bin/oraenv: No such file or directory
[st10@nrs-labs ~]$ find
.
./.elinks
./.elinks/bookmarks
./example1.sql
./11-07-08funct_play2
./f09cs131
./f09cs131/131lab08
./f09cs131/131lab08/try_expr22.cpp
./f09cs131/131lab08/try_expr10.cpp
... <chopped really-long-output> ...
^C
[st10@nrs-labs ~]$ which find
/bin/find
[st10@nrs-labs ~]$ find -version
find (GNU findutils) 4.4.2
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Eric B. Decker, James Youngman, and Kevin Dalley.
Built using GNU gnulib version e5573b1bad88bfabcda181b9e0125fb0c52b7d3b
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION SELINUX FTS() CBO(level=0)
[st10@nrs-labs ~]$ exit
logout
Connection to nrs-labs.humboldt.edu closed.
# yes, Mac's bash Terminal and nrs-labs ARE running different
# versions of find...!
Math-Tuttle-OSX:279lab09 smtuttle$ which find
/usr/bin/find
Math-Tuttle-OSX:279lab09 smtuttle$ find -version
find: illegal option -- v
find: illegal option -- e
find: illegal option -- r
find: illegal option -- i
find: illegal option -- o
find: illegal option -- n
usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]
find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]
Math-Tuttle-OSX:279lab09 smtuttle$ !ssh
ssh st10@nrs-labs.humboldt.edu
st10@nrs-labs.humboldt.edu's password:
Last login: Wed Oct 17 15:07:06 2012 from 137.150.7.22
-bash: /usr/local/bin/oraenv: No such file or directory
[st10@nrs-labs ~]$ cd public_html
[st10@nrs-labs public_html]$ cd f12cs279
[st10@nrs-labs f12cs279]$ mkdir 279lab09
[st10@nrs-labs f12cs279]$ cd 279lab09
[st10@nrs-labs 279lab09]$ ls
[st10@nrs-labs 279lab09]$ find . -print
.
[st10@nrs-labs 279lab09]$ ls -a
. ..
[st10@nrs-labs 279lab09]$ touch .looky
[st10@nrs-labs 279lab09]$ ls
[st10@nrs-labs 279lab09]$ ls -a
. .. .looky
[st10@nrs-labs 279lab09]$ find . -print
.
./.looky
[st10@nrs-labs 279lab09]$ ls -la
total 8
drwxr-xr-x 2 st10 domain users 4096 Oct 17 15:14 .
drwxr-xr-x 30 st10 domain users 4096 Oct 17 15:12 ..
-rw-r--r-- 1 st10 domain users 0 Oct 17 15:14 .looky
[st10@nrs-labs 279lab09]$ find ~/public_html -print
/user-homes/homes/st10/public_html
/user-homes/homes/st10/public_html/435lect09-2-figures.pdf
/user-homes/homes/st10/public_html/435lect05-2.pdf
/user-homes/homes/st10/public_html/f09cs131
/user-homes/homes/st10/public_html/f09cs131/131lab08
/user-homes/homes/st10/public_html/f09cs131/131lab08/131lab08-2
/user-homes/homes/st10/public_html/f09cs131/131lab08/131lab08-2/circ_area_h.html
... <chopped really-long-output> ...
^C
[st10@nrs-labs 279lab09]$ find ~/public_html -name index.php -print
/user-homes/homes/st10/public_html/f11cis450/index.php
/user-homes/homes/st10/public_html/f12cs279/index.php
/user-homes/homes/st10/public_html/f12cs235/index.php
/user-homes/homes/st10/public_html/f10cs131/index.php
/user-homes/homes/st10/public_html/s12cis492/index.php
/user-homes/homes/st10/public_html/f11cis480xp/index.php
/user-homes/homes/st10/public_html/f12cs100/index.php
/user-homes/homes/st10/public_html/f10cis315/index.php
/user-homes/homes/st10/public_html/f11cis235/index.php
/user-homes/homes/st10/public_html/s11cis318/index.php
/user-homes/homes/st10/public_html/index.php
/user-homes/homes/st10/public_html/s12cs435/index.php
/user-homes/homes/st10/public_html/s11cis492/index.php
/user-homes/homes/st10/public_html/s11cs335/index.php
/user-homes/homes/st10/public_html/s12cis318/index.php
[st10@nrs-labs 279lab09]$ find ~/public_html -name index.php -print | wc -l
15
[st10@nrs-labs 279lab09]$ find ~/public_html -name index.php
/user-homes/homes/st10/public_html/f11cis450/index.php
/user-homes/homes/st10/public_html/f12cs279/index.php
/user-homes/homes/st10/public_html/f12cs235/index.php
/user-homes/homes/st10/public_html/f10cs131/index.php
/user-homes/homes/st10/public_html/s12cis492/index.php
/user-homes/homes/st10/public_html/f11cis480xp/index.php
/user-homes/homes/st10/public_html/f12cs100/index.php
/user-homes/homes/st10/public_html/f10cis315/index.php
/user-homes/homes/st10/public_html/f11cis235/index.php
/user-homes/homes/st10/public_html/s11cis318/index.php
/user-homes/homes/st10/public_html/index.php
/user-homes/homes/st10/public_html/s12cs435/index.php
/user-homes/homes/st10/public_html/s11cis492/index.php
/user-homes/homes/st10/public_html/s11cs335/index.php
/user-homes/homes/st10/public_html/s12cis318/index.php
[st10@nrs-labs 279lab09]$ find ~/public_html -name index.php | wc -l
15
[st10@nrs-labs 279lab09]$ touch foo
[st10@nrs-labs 279lab09]$ ls
foo
[st10@nrs-labs 279lab09]$ mkdir more-stuff
[st10@nrs-labs 279lab09]$ touch more-stuff/foo
[st10@nrs-labs 279lab09]$ ls
foo more-stuff
[st10@nrs-labs 279lab09]$ ls more-stuff
foo
[st10@nrs-labs 279lab09]$ find . -print
.
./.looky
./more-stuff
./more-stuff/foo
./foo
[st10@nrs-labs 279lab09]$ find . -name foo
./more-stuff/foo
./foo
[st10@nrs-labs 279lab09]$ find . -name foo | wc
2 2 23
[st10@nrs-labs 279lab09]$ find . -name foo | wc -l
2
[st10@nrs-labs 279lab09]$ find . -name howdy
[st10@nrs-labs 279lab09]$ chmod 000 more-stuff
[st10@nrs-labs 279lab09]$ ls -l
total 4
-rw-r--r-- 1 st10 domain users 0 Oct 17 15:27 foo
d--------- 2 st10 domain users 4096 Oct 17 15:27 more-stuff
[st10@nrs-labs 279lab09]$ find . -name foo
find: `./more-stuff': Permission denied
./foo
[st10@nrs-labs 279lab09]$ find . -name foo > foofiles 2> errors
[st10@nrs-labs 279lab09]$ more foofiles
./foo
[st10@nrs-labs 279lab09]$ more errors
find: `./more-stuff': Permission denied
[st10@nrs-labs 279lab09]$ find . -name foo > foofiles 2> /dev/null
[st10@nrs-labs 279lab09]$ more foofiles
./foo
[st10@nrs-labs 279lab09]$ touch dont-look
[st10@nrs-labs 279lab09]$ chmod 000 dont-look
[st10@nrs-labs 279lab09]$ find . -name dont-look
find: `./more-stuff': Permission denied
./dont-look
[st10@nrs-labs 279lab09]$ chmod 711 more-stuff
[st10@nrs-labs 279lab09]$ mkdir items
[st10@nrs-labs 279lab09]$ ls
dont-look errors foo foofiles items more-stuff
[st10@nrs-labs 279lab09]$ find . -type d -print
.
./more-stuff
./items
[st10@nrs-labs 279lab09]$ man find
[st10@nrs-labs 279lab09]$ find . -type d -name more-stuff -print
./more-stuff
[st10@nrs-labs 279lab09]$ quota
Disk quotas for user st10 (uid 6874):
Filesystem blocks quota limit grace files quota limit grace
/dev/mapper/userhomes
1937960 2048000 3072000 85579 0 0
[st10@nrs-labs 279lab09]$ cd
[st10@nrs-labs ~]$ ls -a
.
..
10-27funct_compile
10-27funct_play2
10-31funct_play2
... <chopped really-long-output> ...
[st10@nrs-labs ~]$ ls -a .*
.bash_history .bashrc .lesshst .nanorc~
.bash_logout .bashrc~ .login .viminfo
.bash_profile .DS_Store .mysql_history .Xauthority
.bash_profile~ .history .nanorc
.:
.
..
10-27funct_compile
10-27funct_play2
10-31funct_play2
11-07-08funct_play2
... <chopped really-long-output> ...
ls: cannot open directory ..: Permission denied
... <chopped more really long output> ...
.recycle:
.
..
Documents.library-ms~RF34bff4ed.TMP
Documents.library-ms~RF34c110e6.TMP
fonts.xml
LastHUs.xml
mredauto.1
Music.library-ms~RF34bff55b.TMP
Pictures.library-ms~RF34bff645.TMP
racket-prefs.rktd
TSTBF6.tmp
Videos.library-ms~RF34bff5d7.TMP
.ssh:
. .. known_hosts known_hosts~
[st10@nrs-labs ~]$ ls -da .*
. .bashrc .gconfd .nanorc~
.. .bashrc~ .history .recycle
.bash_history .DS_Store .lesshst .ssh
.bash_logout .elinks .login .viminfo
.bash_profile .emacs.d .mysql_history .Xauthority
.bash_profile~ .gconf .nanorc
[st10@nrs-labs ~]$ ls .recycle
Documents.library-ms~RF34bff4ed.TMP
Documents.library-ms~RF34c110e6.TMP
fonts.xml
LastHUs.xml
mredauto.1
Music.library-ms~RF34bff55b.TMP
Pictures.library-ms~RF34bff645.TMP
racket-prefs.rktd
TSTBF6.tmp
Videos.library-ms~RF34bff5d7.TMP
[st10@nrs-labs ~]$ cd .recycle
[st10@nrs-labs .recycle]$ ls
Documents.library-ms~RF34bff4ed.TMP
Documents.library-ms~RF34c110e6.TMP
fonts.xml
LastHUs.xml
mredauto.1
Music.library-ms~RF34bff55b.TMP
Pictures.library-ms~RF34bff645.TMP
racket-prefs.rktd
TSTBF6.tmp
Videos.library-ms~RF34bff5d7.TMP
[st10@nrs-labs .recycle]$ rm *
rm: remove regular file `Documents.library-ms~RF34bff4ed.TMP'? y
rm: remove regular file `Documents.library-ms~RF34c110e6.TMP'? y
rm: remove regular empty file `fonts.xml'? y
rm: remove regular empty file `LastHUs.xml'? y
rm: remove regular file `mredauto.1'? y
rm: remove regular file `Music.library-ms~RF34bff55b.TMP'? y
rm: remove regular file `Pictures.library-ms~RF34bff645.TMP'? y
rm: remove regular file `racket-prefs.rktd'? y
rm: remove regular empty file `TSTBF6.tmp'? y
rm: remove regular file `Videos.library-ms~RF34bff5d7.TMP'? y
[st10@nrs-labs .recycle]$ quota
Disk quotas for user st10 (uid 6874):
Filesystem blocks quota limit grace files quota limit grace
/dev/mapper/userhomes
1937920 2048000 3072000 85569 0 0
[st10@nrs-labs .recycle]$ cd
[st10@nrs-labs ~]$ cd public_html/
[st10@nrs-labs public_html]$ cd f12cs279
[st10@nrs-labs f12cs279]$ cd 279lab09
[st10@nrs-labs 279lab09]$ man find
[st10@nrs-labs 279lab09]$ find ~ -mtime -7 -print
/user-homes/homes/st10
/user-homes/homes/st10/279drop
... <more files are less than 7 days old than I expected --
...partially due to ~st10/279drop and ~st10/235drop...!
...chopping these> ...
^C
[st10@nrs-labs 279lab09]$ find ~/public_html -mtime -7 -print
/user-homes/homes/st10/public_html
/user-homes/homes/st10/public_html/235lab09.pdf
/user-homes/homes/st10/public_html/LayoutTrio1Panel$1.class
/user-homes/homes/st10/public_html/LayoutTrio1Applet$1.class
... <this list isn't AS long, but still long enough that
I'll chop here> ...
[st10@nrs-labs 279lab09]$ find ~/public_html -mtime -7 -print | wc -l
80
[st10@nrs-labs 279lab09]$ find ~/public_html -mtime 7 -print | wc -l
22
[st10@nrs-labs 279lab09]$ find ~/public_html -mtime 7 -print
/user-homes/homes/st10/public_html/f12cs279/279lect08-1
/user-homes/homes/st10/public_html/f12cs279/279lect08-1/279lect08-1-history_txt.html
/user-homes/homes/st10/public_html/f12cs279/279lect08-1/clicker-if_sh.html
/user-homes/homes/st10/public_html/f12cs279/279lect08-1/279lect08-1-screen-shot_txt.html
/user-homes/homes/st10/public_html/f12cs279/279lect08-1/blah_txt.html
/user-homes/homes/st10/public_html/f12cs279/279lect08-1/grep1_sh.html
/user-homes/homes/st10/public_html/f12cs279/279lect08-1/pig_txt.html
/user-homes/homes/st10/public_html/f12cs279/279lect08-1/iffy1_sh.html
/user-homes/homes/st10/public_html/f12cs279/279lect08-1/279lect08-1-projected_txt.html
/user-homes/homes/st10/public_html/f12cs279/279lect08-1/piggy_txt.html
/user-homes/homes/st10/public_html/f12cs279/279lect08-1/if-and-re1_sh.html
/user-homes/homes/st10/public_html/f12cs279/index.php
/user-homes/homes/st10/public_html/f12cs279/279lab08/279lab08-ex.pdf
/user-homes/homes/st10/public_html/f12cs235/235ex-list.php~
/user-homes/homes/st10/public_html/f12cs235/235lab08
/user-homes/homes/st10/public_html/f12cs235/235lab08/GridBag1_java.html
/user-homes/homes/st10/public_html/f12cs235/235lab08/235lab08-ex.pdf
/user-homes/homes/st10/public_html/f12cs235/235lab08/LayoutTrio2_java.html
/user-homes/homes/st10/public_html/f12cs235/235lab08/235lab08-projected_txt.html
/user-homes/homes/st10/public_html/f12cs235/235lab08/GridBag0_java.html
/user-homes/homes/st10/public_html/f12cs235/235handouts.php~
/user-homes/homes/st10/public_html/279lab08.pdf
# huh...?
[st10@nrs-labs 279lab09]$ find ~/public_html -mtime 7 -print | ls -l
total 16
---------- 1 st10 domain users 0 Oct 17 15:32 dont-look
-rw-r--r-- 1 st10 domain users 40 Oct 17 15:30 errors
-rw-r--r-- 1 st10 domain users 0 Oct 17 15:27 foo
-rw-r--r-- 1 st10 domain users 6 Oct 17 15:31 foofiles
drwxr-xr-x 2 st10 domain users 4096 Oct 17 15:38 items
drwx--x--x 2 st10 domain users 4096 Oct 17 15:27 more-stuff
[st10@nrs-labs 279lab09]$ find ~/public_html -mtime -7 -print | ls -l
total 16
---------- 1 st10 domain users 0 Oct 17 15:32 dont-look
-rw-r--r-- 1 st10 domain users 40 Oct 17 15:30 errors
-rw-r--r-- 1 st10 domain users 0 Oct 17 15:27 foo
-rw-r--r-- 1 st10 domain users 6 Oct 17 15:31 foofiles
drwxr-xr-x 2 st10 domain users 4096 Oct 17 15:38 items
drwx--x--x 2 st10 domain users 4096 Oct 17 15:27 more-stuff
[st10@nrs-labs 279lab09]$ find ~/public_html -mtime -7 -print | wc -l
80
[st10@nrs-labs 279lab09]$ find ~/public_html -mtime -7 -print
/user-homes/homes/st10/public_html
/user-homes/homes/st10/public_html/235lab09.pdf
/user-homes/homes/st10/public_html/LayoutTrio1Panel$1.class
... <chopping too-long output> ...
[st10@nrs-labs 279lab09]$ ls
dont-look errors foo foofiles items more-stuff
[st10@nrs-labs 279lab09]$ touch file1.txt
[st10@nrs-labs 279lab09]$ touch file2.sh
[st10@nrs-labs 279lab09]$ touch file3.txt
[st10@nrs-labs 279lab09]$ touch file4.sh
[st10@nrs-labs 279lab09]$ ls
dont-look file1.txt file3.txt foo items
errors file2.sh file4.sh foofiles more-stuff
[st10@nrs-labs 279lab09]$ find . -name \*.txt
./file1.txt
./file3.txt
[st10@nrs-labs 279lab09]$ find . -name *.txt
find: paths must precede expression: file3.txt
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
[st10@nrs-labs 279lab09]$ find . -name file\?.txt
./file1.txt
./file3.txt
[st10@nrs-labs 279lab09]$ find . -name file?.txt
find: paths must precede expression: file3.txt
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
[st10@nrs-labs 279lab09]$ find . -name "file?.txt"
./file1.txt
./file3.txt
[st10@nrs-labs 279lab09]$ find . -name 'file?.txt'
./file1.txt
./file3.txt
[st10@nrs-labs 279lab09]$ find ~ -name "*ecycle*
> "^C
[st10@nrs-labs 279lab09]$ find ~ -name "*ecycle*"
/user-homes/homes/st10/.recycle
[st10@nrs-labs 279lab09]$ find ~ -name "*[Rr]ecycle*"
/user-homes/homes/st10/.recycle
[st10@nrs-labs 279lab09]$ find . -name "*[0-9]*"
./file1.txt
./file4.sh
./file2.sh
./file3.txt
[st10@nrs-labs 279lab09]$ arr=(Hello World 313 foo oink)
[st10@nrs-labs 279lab09]$ echo $arr
Hello
[st10@nrs-labs 279lab09]$ arr[0]=Goodbye
[st10@nrs-labs 279lab09]$ echo $arr
Goodbye
[st10@nrs-labs 279lab09]$ arr [ 0 ] = Barn
-bash: arr: command not found
[st10@nrs-labs 279lab09]$ arr[ 0 ]=Barn
[st10@nrs-labs 279lab09]$ echo $arr
Barn
[st10@nrs-labs 279lab09]$ echo $arr[1]
Barn[1]
[st10@nrs-labs 279lab09]$ echo ${arr[1]}
World
[st10@nrs-labs 279lab09]$ echo ${arr[2]}
313
[st10@nrs-labs 279lab09]$ echo ${arr[3]}
foo
[st10@nrs-labs 279lab09]$ arr[57]=moo
[st10@nrs-labs 279lab09]$ echo ${arr[57]}
moo
[st10@nrs-labs 279lab09]$ echo ${arr[*]}
Barn World 313 foo oink moo
[st10@nrs-labs 279lab09]$ echo ${!arr[*]}
0 1 2 3 4 57
[st10@nrs-labs 279lab09]$ echo ${#arr[*]}
6
[st10@nrs-labs 279lab09]$ echo ${#arr[0]}
4
[st10@nrs-labs 279lab09]$ echo ${#arr[1]}
5
[st10@nrs-labs 279lab09]$ echo ${#arr[2]}
3
[st10@nrs-labs 279lab09]$ arr2=(moo a b [10]=oink [15]=moo)
[st10@nrs-labs 279lab09]$ echo ${arr[*]}
Barn World 313 foo oink moo
[st10@nrs-labs 279lab09]$ echo ${arr2[*]}
moo a b oink moo
[st10@nrs-labs 279lab09]$ echo ${!arr2[*]}
0 1 2 10 15
[st10@nrs-labs 279lab09]$ emacs array-play.sh
[1]+ Stopped emacs array-play.sh
[st10@nrs-labs 279lab09]$ chmod 700 array-play.sh
[st10@nrs-labs 279lab09]$ array-play.sh 1 2 3 4 5
array has 5 elements
[st10@nrs-labs 279lab09]$ array-play.sh "1 2" "3 4" 5
array has 3 elements
[st10@nrs-labs 279lab09]$ fg
emacs array-play.sh
[1]+ Stopped emacs array-play.sh
[st10@nrs-labs 279lab09]$ array-play.sh "1 2" "3 4" 5
array has 3 elements
array contents:
1
2
3
4
5
[st10@nrs-labs 279lab09]$ fg
emacs array-play.sh
[1]+ Stopped emacs array-play.sh
[st10@nrs-labs 279lab09]$ array-play.sh "1 2" "3 4" 5
array has 3 elements
array contents:
1 2 3 4 5
[st10@nrs-labs 279lab09]$ fg
emacs array-play.sh
[1]+ Stopped emacs array-play.sh
[st10@nrs-labs 279lab09]$ array-play.sh "1 2" "3 4" 5
array has 3 elements
array contents (where blanks misbehave):
1
2
3
4
5
array contents by their indices
1 2
3 4
5