Revision [2139]

Last edited on 2012-03-12 09:39:41 by KlenwellAdmin
Additions:
Note path and size variables
Deletions:
Note: path and size variables


Revision [2138]

Edited on 2012-03-12 09:39:28 by KlenwellAdmin
Additions:
Note: path and size variables
Deletions:
find **./** -type f -size **+5M** -print0 | xargs -0 ls -1hsS


Revision [2137]

Edited on 2012-03-12 09:38:37 by KlenwellAdmin
Additions:
find **./** -type f -size **+5M** -print0 | xargs -0 ls -1hsS
Source: http://stackoverflow.com/questions/8943154/
$ find ./ -type f -size +5M -print0 | xargs -0 ls -1hsS
11M ./foo/bar/some.log
6.4M ./sample.txt
5.1M ./another/snafu.zip
Deletions:
Favorite methods with sample output
$ find . -size +200k -type f -print0 | xargs -0 ls -Ssh1 | head
2.4M ./foo/bar/some.log
616K ./sample.txt
280K ./another/snafu.zip
$ find . -size +200k -exec du -sk {} \; | sort -nr | less
2364 ./foo/bar/some.log
616 ./sample.txt
280 ./another/snafu.zip


Revision [1929]

Edited on 2011-09-30 16:20:21 by KlenwellAdmin

No Differences

Revision [1928]

Edited on 2011-09-30 16:20:03 by KlenwellAdmin
Additions:
====Find Largest Files / Directories====
===Files===
$ du -B M --max-depth=5 . | sort -n -r | less
898M ./hg
536M ./tmp
362M ./hg/foo
Deletions:
====Find Largest Files====


Revision [1854]

Edited on 2011-05-03 09:52:23 by KlenwellAdmin
Additions:
====Diff====
===Directories===
Deletions:
====Diff Directories===


Revision [1853]

Edited on 2011-05-03 09:51:56 by KlenwellAdmin
Additions:
====Diff Directories===
# with preferred (hg) diff syntax
server:/opt/foo# diff -u conf/ /tmp/foo-conf-back/
diff: conf/cron: No such file or directory
diff: /tmp/foo-conf-back/cron: No such file or directory
Common subdirectories: conf/cron.d and /tmp/foo-conf-back/cron.d
diff -u conf/emailserver.properties /tmp/foo-conf-back/emailserver.properties
--- conf/emailserver.properties 2011-04-14 10:04:47.000000000 -0700
+++ /tmp/foo-conf-back/emailserver.properties 2011-05-03 09:53:42.000000000 -0700
@@ -1,3 +1 @@
-EmailServer=monty.python.com
-EmailTo=mpalin@mailhost.monty.python.com
+diff test
Only in /tmp/foo-conf-back/: lol.conf
# list only files that have changed
server:/opt/foo# diff -q conf/ /tmp/foo-conf-back/
diff: conf/cron: No such file or directory
diff: /tmp/foo-conf-back/cron: No such file or directory
Common subdirectories: conf/cron.d and /tmp/foo-conf-back/cron.d
Files conf/emailserver.properties and /tmp/foo-conf-back/emailserver.properties differ
Only in /tmp/foo-conf-back/: lol.conf


Revision [1852]

Edited on 2011-05-03 09:20:10 by KlenwellAdmin
Additions:
====Find Largest Files====
Deletions:
====Find Largest Directories====


Revision [1742]

Edited on 2010-11-29 10:23:34 by KlenwellAdmin
Additions:
$ zcat file.gz | less
Deletions:
$ zcat file.tgz | less


Revision [1741]

Edited on 2010-11-29 10:22:55 by KlenwellAdmin
Additions:
# list files in zipped archive
$ tar -tvf dir.tar.gz | less
# read content of zipped file (without unzipping)
$ zcat file.tgz | less


Revision [1712]

Edited on 2010-11-13 16:28:26 by KlenwellAdmin
Additions:
# zip /path/to/dir
$ cd /path/to
$ tar -zcvf dir.tar.gz dir
Deletions:
# zip
$ tar -zcvf dir.tar.gz /path/to/dir


Revision [1711]

Edited on 2010-11-13 11:19:19 by KlenwellAdmin
Additions:
====Tar-Zip Directory====
# zip
$ tar -zcvf dir.tar.gz /path/to/dir
# unzip
$ tar -zxvf dir.tar.gz
[[http://www.cyberciti.biz/faq/how-do-i-compress-a-whole-linux-or-unix-directory/ Compress a Whole Linux Directory]] (cyberciti.biz)


Revision [1705]

Edited on 2010-11-10 08:58:25 by KlenwellAdmin
Additions:
[[http://cognitivesandbox.com/posts/finding-large-files/ Finding Large Files]] (cognitivesandbox.com)


Revision [1704]

Edited on 2010-11-10 08:55:17 by KlenwellAdmin
Additions:
====Find Largest Directories====
Favorite methods with sample output
$ find . -size +200k -type f -print0 | xargs -0 ls -Ssh1 | head
2.4M ./foo/bar/some.log
616K ./sample.txt
280K ./another/snafu.zip
$ find . -size +200k -exec du -sk {} \; | sort -nr | less
2364 ./foo/bar/some.log
616 ./sample.txt
280 ./another/snafu.zip


Revision [1650]

Edited on 2010-10-15 12:49:53 by KlenwellAdmin
Additions:
===Basic Example===


Revision [1649]

Edited on 2010-10-15 12:49:20 by KlenwellAdmin
Additions:
===Grep By File Type===
ref: http://www.unix.com/302166849-post3.html
$ find . -type f -name '*.log' -exec grep -Hn 'foo' {} \; | less


Revision [1648]

Edited on 2010-10-15 12:39:52 by KlenwellAdmin
Additions:
===Find Image Files===
$ find . -type f -name *.jpg -o -name *.png -o -name *.gif | less


Revision [1567]

Edited on 2010-09-15 11:05:29 by KlenwellAdmin
Additions:
$ find . -name *.log
Deletions:
find . -name *.log


Revision [1566]

The oldest known version of this page was created on 2010-09-15 11:05:18 by KlenwellAdmin
Valid XHTML 1.0 TransitionalValid CSSWikkaWiki