├── debian ├── changelog ├── compat ├── control ├── copyright ├── docs ├── fslint.manpages ├── rules └── watch ├── doc ├── FAQ ├── NEWS ├── README └── TODO ├── fslint-gui ├── fslint.desktop ├── fslint.glade ├── fslint.gladep ├── fslint.spec ├── fslint ├── findbl ├── finded ├── findid ├── findnl ├── findns ├── findrs ├── findsn ├── findtf ├── findu8 ├── findul ├── findup ├── fslint ├── fstool │ ├── dir_size │ ├── dupwaste │ ├── edu │ └── lS ├── supprt │ ├── fslver │ ├── getffl │ ├── getffp │ ├── getfpf │ ├── md5sum_approx │ └── rmlint │ │ ├── fix_ws.sh │ │ ├── fixdup │ │ ├── fixdup.sh │ │ ├── merge_hardlinks │ │ └── view_ws.sh └── zipdir ├── fslint_icon.png ├── glade-fixup ├── man ├── fslint-gui.1 └── fslint.1 └── po ├── Makefile ├── ca.po ├── cs.po ├── da.po ├── de.po ├── el.po ├── es.po ├── fi.po ├── fr.po ├── fslint.pot ├── ga.po ├── gl.po ├── he.po ├── hu.po ├── it.po ├── ja.po ├── ms.po ├── nl.po ├── pl.po ├── pt.po ├── ro.po ├── ru.po ├── sk.po ├── sr.po ├── sv.po ├── tr.po ├── uk.po ├── vi.po └── zh_CN.po /debian/changelog: -------------------------------------------------------------------------------- 1 | fslint (2.47-1) unstable; urgency=low 2 | 3 | * bump to devel version 4 | 5 | -- Pádraig Brady
wed, 01 feb 2017 22:32:00 +0000 6 | 7 | fslint (2.46-1) unstable; urgency=low 8 | 9 | * bump to release version 10 | 11 | -- Pádraig Brady
wed, 01 feb 2017 22:31:00 +0000 12 | 13 | fslint (2.45-1) unstable; urgency=low 14 | 15 | * bump to devel version 16 | 17 | -- Pádraig Brady
mon, 13 jan 2014 08:32:00 +0000 18 | 19 | fslint (2.44-1) unstable; urgency=low 20 | 21 | * bump to release version 22 | 23 | -- Pádraig Brady
mon, 13 jan 2014 08:31:00 +0000 24 | 25 | fslint (2.43-1) unstable; urgency=low 26 | 27 | * bump to devel version 28 | 29 | -- Pádraig Brady
thu, 29 apr 2010 23:57:00 +0000 30 | 31 | fslint (2.42-1) unstable; urgency=low 32 | 33 | * bump to release version 34 | 35 | -- Pádraig Brady
thu, 29 apr 2010 08:31:00 +0000 36 | 37 | fslint (2.41-1) unstable; urgency=low 38 | 39 | * bump to devel version 40 | * Use POSIX process substitution shell syntax (Closes: 548787) 41 | * Add detail on each fslint command to man page (Closes: 548685) 42 | 43 | -- Pádraig Brady
tue, 21 jul 2009 01:58:00 +0000 44 | 45 | fslint (2.40-2) unstable; urgency=low 46 | 47 | * Fixup warnings from running lintian on source package 48 | 49 | -- Pádraig Brady
thu, 23 jul 2009 09:27:00 +0000 50 | 51 | fslint (2.40-1) unstable; urgency=low 52 | 53 | * bump to release version 54 | 55 | -- pádraig brady
tue, 21 jul 2009 00:07:00 +0000 56 | 57 | fslint (2.29-1) unstable; urgency=low 58 | 59 | * Bump to devel version 60 | * Add the debian updated German translation (Closes: 503232) 61 | * Add findutils as a dependency (Closes: 511805) 62 | * Give more info on CLI tools in fslint-gui man page (Closes: 511806) 63 | 64 | -- pádraig brady
tue, 09 sep 2008 10:39:00 +0000 65 | 66 | fslint (2.28-1) unstable; urgency=low 67 | 68 | * bump to release version 69 | 70 | -- pádraig brady
tue, 09 sep 2008 08:09:00 +0000 71 | 72 | fslint (2.27-1) unstable; urgency=low 73 | 74 | * Bump to devel version 75 | * Remove `echo -e` bashism from ancillary scripts (Closes: #489597) 76 | 77 | -- Pádraig Brady
Tue, 10 Jul 2008 23:47:00 +0000 78 | 79 | fslint (2.26-2) unstable; urgency=low 80 | 81 | * Minor packaging cleanups suggested by Cameron Dale 82 | 83 | -- Pádraig Brady
Thu, 22 May 2008 15:17:00 +0000 84 | 85 | fslint (2.26-1) unstable; urgency=low 86 | 87 | * Bump to release version 88 | 89 | -- Pádraig Brady
Tue, 20 May 2008 08:06:00 +0000 90 | 91 | fslint (2.25-1) unstable; urgency=low 92 | 93 | * Bump to devel version 94 | * Remove bash dependency from "fix whitespace" script (Closes: #446326) 95 | * Remove bc dependency from "dupwaste" script (Closes: #448882) 96 | 97 | -- Pádraig Brady
Thu, 19 Sep 2007 10:40:00 +0000 98 | 99 | fslint (2.24-1) unstable; urgency=low 100 | 101 | * Bump to release version 102 | 103 | -- Pádraig Brady
Thu, 19 Sep 2007 07:38:00 +0000 104 | 105 | fslint (2.23-1) unstable; urgency=low 106 | 107 | * Bump to devel version 108 | 109 | -- Pádraig Brady
Thu, 28 Jun 2007 16:38:00 +0000 110 | 111 | fslint (2.22-2) unstable; urgency=low 112 | 113 | * Minor packaging cleanups suggested by Bart Martens 114 | 115 | -- Pádraig Brady
Mon, 02 Jul 2007 07:50:00 +0000 116 | 117 | fslint (2.22-1) unstable; urgency=low 118 | 119 | * Bump to release version 120 | 121 | -- Pádraig Brady
Thu, 28 Jun 2007 16:02:00 +0000 122 | 123 | fslint (2.21-1) unstable; urgency=low 124 | 125 | * Bump to devel version 126 | * Remove findup -m cross device limitation (Closes: #426522) 127 | 128 | -- Pádraig Brady
Fri, 30 Mar 2007 08:22:00 +0000 129 | 130 | fslint (2.20-1) unstable; urgency=low 131 | 132 | * Update description to make FSlint easier to find (Closes: #413907) 133 | * Bump to release version 134 | 135 | -- Pádraig Brady
Fri, 09 Mar 2007 07:54:00 +0000 136 | 137 | fslint (2.19-2) unstable; urgency=low 138 | 139 | * add md5sum_approx 140 | 141 | -- Pádraig Brady
Fri, 02 Feb 2007 00:34:00 +0000 142 | 143 | fslint (2.19-1) unstable; urgency=low 144 | 145 | * Bump to devel version 146 | 147 | -- Pádraig Brady
Tue, 26 Dec 2006 14:54:00 +0000 148 | 149 | fslint (2.18-1) unstable; urgency=low 150 | 151 | * Bump to release version (Closes: #379999, #380208, #397046) 152 | 153 | -- Pádraig Brady
Mon, 25 Dec 2006 23:54:00 +0000 154 | 155 | fslint (2.17-1) unstable; urgency=low 156 | 157 | * Bump to devel version 158 | 159 | -- Pádraig Brady
Tue, 28 Nov 2006 17:25:30 +0000 160 | 161 | fslint (2.16-1) unstable; urgency=low 162 | 163 | * Cleanups suggested by lintian 164 | 165 | -- Pádraig Brady
Thu, 01 Jun 2006 09:09:13 +0000 166 | 167 | fslint (2.15-1) unstable; urgency=low 168 | 169 | * Cleanups suggested by Justin Pryzsb 170 | 171 | -- Pádraig Brady
Thu, 09 Mar 2006 08:50:03 +0000 172 | 173 | fslint (2.14-1) unstable; urgency=low 174 | 175 | * Initial release 176 | 177 | -- Pádraig Brady
Thu, 16 Feb 2006 18:52:06 +0000 178 | 179 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 5 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: fslint 2 | Section: admin 3 | Priority: optional 4 | Maintainer: Pádraig Brady
5 | Homepage: http://www.pixelbeat.org/fslint/ 6 | Build-Depends: debhelper (>= 5) 7 | Build-Depends-Indep: gettext (>= 0.13) 8 | Standards-Version: 3.8.0 9 | 10 | Package: fslint 11 | Architecture: all 12 | Depends: python (>= 2.6), python-gtk2 (>= 2.4), python-glade2, findutils (>=4.1.1) 13 | Description: A utility to fix problems with filesystems' data, like duplicate files 14 | FSlint is a toolkit to clean filesystem lint. It includes a GTK+ GUI 15 | as well as a command line interface and can be used to reclaim disk space. 16 | It has an interface for uninstalling packages, and it can find things like: 17 | . 18 | - Duplicate files 19 | - Problematic filenames 20 | - Temporary files 21 | - Bad symlinks 22 | - Empty directories 23 | - Nonstripped binaries 24 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Pádraig Brady
on 2 | Thu, 16 Feb 2006 18:52:06 +0000. 3 | 4 | It was downloaded from http://www.pixelbeat.org/fslint 5 | 6 | Copyright Holder: (C) 2000-2010 Pádraig Brady
7 | 8 | License: 9 | 10 | This package is free software; you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation; either version 2 of the License, or 13 | any later version. 14 | 15 | This package is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | On Debian systems, the complete text version 2 of the GNU General 21 | Public License can be found in `/usr/share/common-licenses/GPL'. 22 | 23 | -------------------------------------------------------------------------------- /debian/docs: -------------------------------------------------------------------------------- 1 | doc/* 2 | -------------------------------------------------------------------------------- /debian/fslint.manpages: -------------------------------------------------------------------------------- 1 | man/* 2 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | name = fslint 13 | installdir = debian/$(name) 14 | bindir = $(installdir)/usr/bin 15 | _datadir = /usr/share 16 | datadir = $(installdir)$(_datadir) 17 | 18 | build: 19 | dh_testdir 20 | # Could modify source here before install, 21 | # but doing so would not allow one to run dpkg-buildpackage 22 | # from a working source tree. 23 | # Instead source edits are done in install: 24 | 25 | clean: 26 | dh_testdir 27 | dh_testroot 28 | $(MAKE) -C po clean 29 | dh_clean 30 | 31 | install: 32 | dh_testdir 33 | dh_testroot 34 | dh_clean 35 | 36 | # Note dh_installdirs will create dirs listed in fslint.dirs 37 | # Note dh_install will install files listed in fslint.install 38 | install -Dpm 755 fslint-gui ${bindir}/fslint-gui 39 | sed -i -e 's|^liblocation=.*|liblocation="${_datadir}/${name}" #deb edit|' ${bindir}/fslint-gui 40 | sed -i -e 's|^locale_base=.*|locale_base=None #deb edit|' ${bindir}/fslint-gui 41 | 42 | install -dm 755 ${datadir}/${name}/fslint/fstool 43 | install -dm 755 ${datadir}/${name}/fslint/supprt 44 | install -dm 755 ${datadir}/${name}/fslint/supprt/rmlint 45 | install -pm 644 fslint.glade fslint_icon.png ${datadir}/${name} 46 | install -dm 755 ${datadir}/pixmaps 47 | ln -s ../${name}/fslint_icon.png ${datadir}/pixmaps 48 | install -pm 755 fslint/find* fslint/fslint fslint/zipdir ${datadir}/${name}/fslint 49 | install -pm 755 fslint/fstool/* ${datadir}/${name}/fslint/fstool 50 | install -pm 755 fslint/supprt/get* ${datadir}/${name}/fslint/supprt 51 | install -pm 755 fslint/supprt/md5sum_approx ${datadir}/${name}/fslint/supprt 52 | install -pm 644 fslint/supprt/fslver ${datadir}/${name}/fslint/supprt 53 | install -pm 755 fslint/supprt/rmlint/* ${datadir}/${name}/fslint/supprt/rmlint 54 | $(MAKE) -C po DESTDIR=$(CURDIR)/$(installdir) install 55 | 56 | #Note dh_desktop doesn't install desktop files? 57 | install -Dpm 644 fslint.desktop ${datadir}/applications/fslint.desktop 58 | 59 | 60 | # Build architecture-dependent files here. 61 | binary-dep: build 62 | 63 | # Build architecture-independent files here. 64 | binary-indep: install 65 | dh_testdir 66 | dh_testroot 67 | dh_installchangelogs 68 | dh_installdocs 69 | dh_installman 70 | dh_compress 71 | dh_fixperms 72 | dh_installdeb 73 | dh_shlibdeps 74 | dh_gencontrol 75 | dh_md5sums 76 | dh_builddeb 77 | 78 | binary: binary-indep 79 | 80 | binary-arch: 81 | 82 | .PHONY: build clean binary-indep binary install 83 | -------------------------------------------------------------------------------- /debian/watch: -------------------------------------------------------------------------------- 1 | # watch control file for uscan. 2 | # You can run the "uscan" command 3 | # to check for upstream updates and more. 4 | # See uscan(1) for format 5 | 6 | # Compulsory line, this is a version 3 file 7 | version=3 8 | 9 | # Uncomment to examine a Webserver directory 10 | http://www.pixelbeat.org/fslint/fslint-(.*)\.tar\.gz 11 | -------------------------------------------------------------------------------- /doc/FAQ: -------------------------------------------------------------------------------- 1 | Q. What algorithm is used to check for duplicate files? 2 | A. On a standard install, you can see the script used in 3 | /usr/share/fslint/fslint/findup. In summary the algorithm is: 4 | 1. exclude files with unique lengths 5 | 2. handle files that are hardlinked to each other 6 | 3. exclude files with unique md5(first_4k(file)) 7 | 4. exclude files with unique md5(whole file) 8 | 5. exclude files with unique sha1(whole file) (in case of md5 collisions). 9 | 10 | Q. Is there a command line version? 11 | A. Yes, you can download the tarball and cd to 12 | the fslint directory, and use it directly from there. 13 | Note the GUI just wraps these command line programs, 14 | so alternatively you can cd or add to $PATH the 15 | /usr/share/fslint/fslint directory on a standard install. 16 | 17 | Q. Can I download the tarball and hack & run the GUI without installing it? 18 | A. Yes, just run ./fslint-gui from the directory you extract 19 | and it automatically notices this and uses just the 20 | files in the extracted directory. Note you will need 21 | to do a make in the po directory for i18n to work. 22 | 23 | Q. Where's the Makefile? How do I build/install it from source? 24 | A. It's python so nothing needs to be built on the target. 25 | There's no Makefile to [un]install because there's no need (see previous FAQ) 26 | To build an rpm just tar.gz the working directory to fslint-x.xx.tar.gz. 27 | For example: tar czf fslint-2.17.tar.gz --exclude=.svn fslint 28 | and then: rpmbuild -ta fslint-x.xx.tar.gz. Alternatively 29 | to build a deb just cp -a the working directory to fslint-x.xx 30 | and then: cd fslint-x.xx && dpkg-buildpackage -I.svn -rfakeroot -tc 31 | 32 | Q. The released RPM doesn't install on mandriva or SuSE? 33 | A. Unfortunately Mandriva and SuSE at least use different 34 | pygtk package names to fedora/redhat. 35 | FSlint does support automatically building the correct package 36 | on the mandriva and suse platforms. To build a package for these 37 | distros, just get the release tar.gz and as in the previous FAQ: 38 | sudo rpmbuild -ta fslint-x.xx.tar.gz 39 | 40 | Q. Why does the GUI default to including my $HOME dir, and how do I change it? 41 | A. Well more accurately it adds the current working directory by default, 42 | so when started from the gnome menu, it will default to $HOME. 43 | You can pass (multiple) directories on the command line like: 44 | Alt-F2 -> fslint-gui /your/dir 45 | Or you could edit the menu entry to hardcode a different start path. 46 | 47 | Q. In the GUI how do I exclude dirs (and and sub-dirs) matching a pattern? 48 | A. In "Advanced Search Parameters"->"Paths to exclude", add 49 | "*/CVS" to exclude all CVS dirs for example 50 | 51 | Q. In the GUI how do I exclude files matching a pattern? 52 | A. In "Advanced Search Parameters"->"Extra find parameters", add: 53 | \( ! -name COPYING* -a ! -name LICENSE \) 54 | to exclude licence files, for example. See `man find` (section 'EXPRESSION') 55 | for more guidance on the proper format for queries. 56 | 57 | Q. From the command line how do I exclude paths matching a pattern? 58 | A. To exclude directories: findup \( -path "*/.svn" \) -prune -o 59 | To exclude files: findup \( ! -name "*.py[co]" \) 60 | 61 | Q. How do I navigate the file lists with the keyboard? 62 | A. FSlint uses a GtkCList in "multiple selection" mode throughout. 63 | 64 | 1. Ctrl + up, down to scroll the list. 65 | 2. up, down, PgUp, PgDown, Ctrl+home and Ctrl+end to change selected item. 66 | 3. Shift + the movement keys extends a contiguous selection. 67 | 4. Ctrl + space, toggles the discontiguous selection mode. 68 | When in this mode, one can navigate to any row using the movement keys 69 | and space will toggle that row's selection state. Also holding Shift 70 | while using the movement keys will extend the selection. 71 | 72 | For completeness the mouse works like: 73 | 74 | 1. Clicking an item selects it. 75 | 2. Ctrl+click adds toggles rows to and from a discontiguous selection. 76 | 3. Dragging the mouse over rows makes a contiguous selection. 77 | 4. Shift+click extends a contiguous selection to the clicked row. 78 | -------------------------------------------------------------------------------- /doc/README: -------------------------------------------------------------------------------- 1 | OVERVIEW: 2 | 3 | FSlint - A utility to find File System lint. 4 | This includes duplicate files, empty directories, 5 | problematic filenames, etc. 6 | 7 | LICENCE: 8 | 9 | Copyright © 2000-2009 by Pádraig Brady
.
10 |
11 | This program is free software; you can redistribute it and/or modify
12 | it under the terms of the GNU General Public License as published by
13 | the Free Software Foundation; either version 2 of the License, or
14 | any later version.
15 |
16 | This program is distributed in the hope that it will be useful,
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 | See the GNU General Public License for more details,
20 | which is available at www.gnu.org
21 |
22 | CONTACT INFO:
23 |
24 | Any bugs/patches/suggestions/flames should be directed to:
25 | P@draigBrady.com
26 |
27 | INSTALLATION:
28 |
29 | RPM or DEB. Note since FSlint does not need to be compiled
30 | one can run it directly from the extracted source directory.
31 | Please see the FAQ for details on building installation packages.
32 |
33 | REQUIREMENTS:
34 |
35 | The 1.1 branch requires textutils >= 2.0.21 or coreutils.
36 | In addition for the gui versions:
37 |
38 | For the 2.40 branch (fedora core 2 or higher)
39 | gtk2 >= 2.4 (ftp://ftp.gtk.org/pub/gtk/)
40 | python >= 2.6 (http://www.python.org/download/)
41 | libglade >= 2.4 (http://ftp.gnome.org/pub/GNOME/sources/libglade/)
42 | pygtk2 >= 2.4 (ftp://ftp.gtk.org/pub/gtk/python/)
43 |
44 | For the 2.0 branch (redhat 8.x or higher)
45 | gtk2 >= 2.0 (ftp://ftp.gtk.org/pub/gtk/)
46 | python >= 2.0 (http://www.python.org/download/)
47 | libglade >= 2.0 (http://ftp.gnome.org/pub/GNOME/sources/libglade/)
48 | pygtk2 >= 2.0 (ftp://ftp.gtk.org/pub/gtk/python/)
49 | Note the required pygtk2-libglade rpm is also made from pygtk2 source
50 |
51 | For the 1.2 branch (redhat 7.x or higher)
52 | gtk >= 1.2 (ftp://ftp.gtk.org/pub/gtk/)
53 | python >= 1.5 (http://www.python.org/download/)
54 | libglade >= 0.x (http://ftp.gnome.org/pub/GNOME/sources/libglade/)
55 | pygtk >= 1.2 (ftp://ftp.gtk.org/pub/gtk/python/)
56 |
57 | Note installation order is important if installing from source.
58 |
59 | DESCRIPTION:
60 |
61 | FSlint is a toolkit to find redundant/questionable disk usage.
62 | The fslint-gui command invokes the GUI interface. There is also
63 | a command line interface to each tool which can be accessed
64 | from the /usr/share/fslint/fslint directory usually.
65 | The command fslint is a wrapper for the various
66 | tools which can be called individually. All the tools
67 | (including fslint) have the same interface, which is
68 | basically:
69 |
70 | command [-r] [-f] [path1 [path2]...]
71 |
72 | where the paths are files &/or directories
73 | If no paths are specified then the current
74 | directory is assumed.
75 |
76 | -r means do NOT recurse the specified director{y,ies}
77 | -f means output full paths even if only 1 path specified
78 |
79 | some tools have their own options. To get help on
80 | each tool do:
81 |
82 | command --help
83 |
84 | Any extra commands are passed to find, so any of
85 | filtering commands will work, for e.g the following
86 | means process the whole system but do not traverse
87 | onto any other mounted filesystems:
88 |
89 | fslint / -xdev
90 |
91 | More examples:
92 |
93 | search for duplicates in current directory and below
94 | findup or findup .
95 | same as above but don't look in subdirectories
96 | findup -r .
97 | search for duplicate names in /usr/bin
98 | findsn /usr/bin
99 | search in multiple directories but not their subdirectories
100 | findsn -r /usr/bin /bin /usr/sbin /sbin
101 | search system for duplicate files over 100K in size
102 | findup / -size +100k
103 | search only my files (that I own and are in my home dir)
104 | findsn ~ -user `id -u`
105 | search system for duplicate files names belonging to "root"
106 | findsn / -user `id -u root`
107 |
108 | Note the fslint tools do a lot of inode access and to speed them
109 | up you can use the following method to not update access times
110 | on disk while gathering inode information:
111 | mount -o remount,noatime mountpoint
112 | fslint
113 | mount -o atime,remount mountpoint
114 |
--------------------------------------------------------------------------------
/doc/TODO:
--------------------------------------------------------------------------------
1 | New widgets to try are (grouped) GtkClist -> Gtk{TreeView,Model}
2 |
3 | Use checkboxes within package list to mark a package for deletion,
4 | rather than selecting the whole row. This is much easier to code for
5 | and will allow the user to easily sort by selection state also.
6 | In addition we would autosort by this selection state when packages are
7 | automatically selected for deletion through dependency analysis,
8 | so that users could easily review the updated selection.
9 |
10 | This (small) limitation is hard to fix but since $# (the number of params)
11 | is checked for in findsn, you can't do stuff like:
12 | findsn -A -name "python*"
13 | Would need to check no paths specified (I.E. like what getfpf does).
14 |
15 | would be good to merge hardlinked files in findns
16 |
--------------------------------------------------------------------------------
/fslint.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | Name=FSlint
3 | Comment=File System Lint detector and cleaner
4 | Exec=fslint-gui
5 | Terminal=false
6 | Type=Application
7 | Icon=fslint_icon
8 | Categories=System;Filesystem;GTK;Utility;
9 | X-Ubuntu-Gettext-Domain=fslint
10 | Keywords=duplicate;redundant;file;
11 |
--------------------------------------------------------------------------------
/fslint.gladep:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | .
5 | #
6 | # This program is free software; you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation; either version 2 of the License, or
9 | # any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 | # See the GNU General Public License for more details,
15 | # which is available at www.gnu.org
16 |
17 |
18 | # Notes:
19 | #
20 | # By default (-d) it reports dangling (stale) links. Note invalid
21 | # pathnames are reported as stale by this script.
22 | #
23 | # To report redundant info in symbolic links, such as multiple
24 | # consequtive ////'s or /./././ etc. you specify the -n option.
25 | # Note that fixing this won't give you back any disk space as
26 | # the link will take a disk block anyway, but malformed links
27 | # like this could cause other programs problems.
28 | #
29 | # To report all absolute links in the specified path(s), use
30 | # the -A option. This can help when you want to move a tree
31 | # around in the filesystem.
32 | #
33 | # Likewise the -l option reports all relative links in the
34 | # specified paths.
35 | #
36 | # The -s option reports suspect absolute links. I.E. absolute
37 | # links to files in the same directory as the link or below.
38 | # TODO: support finding suspect relative link also. For e.g.:
39 | # /etc/file.lnk ->../etc/file (python and abspath may be needed?)
40 | #
41 | # Note if this output passed to xargs or rm etc.
42 | # then filenames with spaces will cause problems
43 | #
44 | # Should insert list of filesystems that support links
45 | # or specify -xdev or something
46 | #
47 | # auto tidying of messy links could use tr -s / to squeeze consequtive /'s
48 | # and sed s//..///d to remove /../
49 |
50 | script_dir=$(dirname "$0") #directory of this script
51 | script_dir=$(readlink -f "$script_dir") #Make sure absolute path
52 |
53 | . "$script_dir"/supprt/fslver
54 |
55 | Usage() {
56 | ProgName=$(basename "$0")
57 | echo "find \"Bad\" symbolic Links.
58 | Usage: $ProgName [-d] [-s] [-l] [-s] [-n] [[-r] [-f] paths(s) ...]
59 |
60 | These options are mutually exclusive (i.e. only the last one takes effect).
61 | -d Dangling (or stale) links. This is the default mode
62 | -s Suspect links (absolute links to paths within or below the link's directory)
63 | -l all reLative links
64 | -A all Absolute links
65 | -n reduNdant info in links (/././. ///// /../ etc.)
66 |
67 | If no path(s) specified, then the current directory is assumed.
68 |
69 | e.g. find dangling links in "library directories":
70 | findbl \$(getffl)"
71 | exit
72 | }
73 |
74 | mode="dangling" #default
75 |
76 | # Note must be careful with expressions (which are currently
77 | # wrong I think), as the following are valid file/dir names:
78 | # " ...", "..." etc. Hmm the symlinks program probably doesn't
79 | # handle this correctly either?
80 |
81 | ASC_01=$(printf "\001")
82 |
83 | for arg
84 | do
85 | case "$arg" in
86 | -d)
87 | mode="dangling" ;;
88 | -s)
89 | mode="suspect" ;;
90 | -A)
91 | mode="absolute"
92 | search_expr="${ASC_01}/" ;;
93 | -l)
94 | mode="relative"
95 | search_expr="${ASC_01}[^/]+" ;;
96 | -n)
97 | mode="redundant"
98 | search_expr="(${ASC_01}.*[/]{2,})" #finds 2 or more consequtive /'s
99 | search_expr="$search_expr|([${ASC_01}/]\./)" # starting with ./ or /./ anywhere
100 | search_expr="$search_expr|(${ASC_01}.*[^.]+/[.][.]/)" #finds x/../y
101 | search_expr="$search_expr|(${ASC_01}/[.][.]/)" #finds /../y
102 | search_expr="$search_expr|(${ASC_01}.*[.]{3,}/[.][.]/)" #finds .../../y etc
103 | search_expr="$search_expr|(${ASC_01}.+/$)" ;; #finds ending with /
104 | -h|--help|-help)
105 | Usage ;;
106 | -v|--version)
107 | Version ;;
108 | *)
109 | argsToPassOn="$argsToPassOn $(shell_quote "$arg")" ;;
110 | esac
111 | done
112 |
113 | . "$script_dir"/supprt/getfpf "$argsToPassOn"
114 |
115 | EPWD=$(pwd | sed 's#/#\\/#g')
116 |
117 | case "$mode" in
118 | suspect)
119 | FPF="$FPF ->\1%p\1%l" ;;
120 | absolute|relative|redundant)
121 | FPF="$FPF ->\1%l" ;;
122 | esac
123 |
124 | find "$@" -type l ! -name "*$LF*" -printf "$FPF\n" |
125 | sort -u | #merge links (indirectly) specified multiple times
126 |
127 | case "$mode" in
128 | dangling)
129 | #perl -nle '-e || print' | #this is much faster than below
130 | #/usr/share/dict/words is 45424 lines which is 0.12s for
131 | #perl and 3.8s for shell while read! should be OK though?
132 | #Note also this doesn't distinguish EPERM and ENOENT
133 | while read; do file="$REPLY"; [ -e "$file" ] || echo $file; done |
134 | tr '\n' '\0' |
135 | xargs -r0 ls -lUd -- |
136 | sed 's/.*[0-9]\{2\} \(.* ->.*\)/\1/' ;; #only leave link -> target
137 | suspect)
138 | grep "${ASC_01}.*${ASC_01}/" | #get absolute links
139 | sed -e "s/${ASC_01}.\//${ASC_01}$EPWD\//g" | #change rel to abs paths
140 | grep -E "${ASC_01}(.*)/[^/]+${ASC_01}\1" | #find suspect links
141 | sed -e "s/${ASC_01}.*${ASC_01}/ /g" ;; #drop work column
142 | absolute|relative|redundant)
143 | grep -E "$search_expr" |
144 | tr '\1' ' ' ;;
145 | esac
146 |
--------------------------------------------------------------------------------
/fslint/finded:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # finded - find empty directory branches
4 | # Copyright © 2000-2009 by Pádraig Brady .
5 | #
6 | # This program is free software; you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation; either version 2 of the License, or
9 | # any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 | # See the GNU General Public License for more details,
15 | # which is available at www.gnu.org
16 |
17 | script_dir=$(dirname "$0") #directory of this script
18 | script_dir=$(readlink -f "$script_dir") #Make sure absolute path
19 |
20 | . "$script_dir"/supprt/fslver
21 |
22 | Usage() {
23 | ProgName=$(basename "$0")
24 | echo "find Empty Directory branches.
25 | Usage: $ProgName [[-r] [-f] paths(s) ...]
26 |
27 | If no path(s) specified then the current directory is assumed."
28 | exit
29 | }
30 |
31 | for arg
32 | do
33 | case "$arg" in
34 | -h|--help|-help)
35 | Usage ;;
36 | -v|--version)
37 | Version ;;
38 | *|-r)
39 | test "$arg" = "-r" && recurse="false"
40 | argsToPassOn="$argsToPassOn $(shell_quote "$arg")" ;;
41 | esac
42 | done
43 |
44 | . "$script_dir"/supprt/getfpf -f "$argsToPassOn"
45 | #forcing -f as if specify an empty dir it would not display
46 |
47 | if test "$recurse" = "false"; then
48 | find "$@" -empty -type d ! -name "*$LF*" -printf "$FPF\0" |
49 | sort -zu | #merge dirs (indirectly) specified multiple times
50 | if [ ! -p /proc/self/fd/1 ]; then
51 | xargs -r0 ls -b1Ud --
52 | else
53 | cat
54 | fi
55 | exit
56 | fi
57 |
58 | #flag trailing / as an error
59 | if printf "%s\n" "$@" | tr -s '/' | grep -q './$'; then
60 | echo "Error: trailing '/' in a parameter is not allowed" >&2
61 | exit 1
62 | fi
63 |
64 | (
65 | #get all dirs
66 | find "$@" -type d ! -name "*$LF*" -printf "$FPF\n" |
67 | sort -u #merge dirs (indirectly) specified multiple times
68 |
69 | #get all dirs containing files.
70 | #Note / not included for absolute dirs, but we assume / has files
71 | find "$@" ! -type d ! -name "*$LF*" -printf "%h\n" |
72 | uniq | #quick merge of dir names for each file
73 | sed -n ':s; p;p; s#/\{0,\}[^/]\{1,\}$##; /./b s' #separate dir nodes
74 |
75 | #Ensure we exclude parents to specified absolute dirs
76 | find "$@" -maxdepth 0 ! -name "*$LF*" -printf "%h\n%h\n" |
77 | sed '/^\//!d' | #only process absolute dirs
78 | sed -n ':s; p;p; s#/\{0,\}[^/]\{1,\}$##; /./b s' #separate dir nodes
79 | ) |
80 | #get dirs only containing dirs, or nothing at all
81 | sort | uniq -u |
82 |
83 | #reduce to parent (prefixes)
84 | sed 'p; :s $!N; s/^\(.*\)\n\1\/.*/\1/; t s; D' |
85 |
86 | #make further processing immune to blanks
87 | tr '\n' '\0' |
88 |
89 | if [ ! -p /proc/self/fd/1 ]; then
90 | xargs -r0 ls -b1Ud --
91 | else
92 | cat
93 | fi
94 |
--------------------------------------------------------------------------------
/fslint/findid:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # findid - find invalid user ids
4 | # Copyright © 2000-2009 by Pádraig Brady .
5 | #
6 | # This program is free software; you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation; either version 2 of the License, or
9 | # any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 | # See the GNU General Public License for more details,
15 | # which is available at www.gnu.org
16 |
17 | script_dir=$(dirname "$0") #directory of this script
18 | script_dir=$(readlink -f "$script_dir") #Make sure absolute path
19 |
20 | . "$script_dir"/supprt/fslver
21 |
22 | Usage() {
23 | ProgName=$(basename "$0")
24 | echo "find unused or bad file ids
25 | Usage: $ProgName [[-r] [-f] paths(s) ...]
26 |
27 | If no path(s) specified then the current directory is assumed."
28 | exit
29 | }
30 |
31 | for arg
32 | do
33 | case "$arg" in
34 | -h|--help|-help)
35 | Usage ;;
36 | -v|--version)
37 | Version ;;
38 | *)
39 | argsToPassOn="$argsToPassOn $(shell_quote "$arg")" ;;
40 | esac
41 | done
42 |
43 | . "$script_dir"/supprt/getfpf "$argsToPassOn"
44 |
45 | reUsers="$(cut -f3 -d: /etc/passwd | tr '\n' '|')0"
46 | reGroups="$(cut -f3 -d: /etc/group | tr '\n' '|')0"
47 | find -H "$@" -printf "%U:%G:$FPF\0" |
48 | sort -zu | #merge files (indirectly) specified multiple times
49 | tr '\n\0' '\1\n' |
50 | grep -Ev "^($reUsers):($reGroups):" |
51 | cut -d: -f3- |
52 | tr '\n\1' '\0\n' |
53 |
54 | #Note this find command is equivalent to the above.
55 | #However it's much slower. This really shows the
56 | #advantage of the small cohesive tools paradigm.
57 | #find $findArgs \( -nouser -o -nogroup \) -printf "$FPF\0" |
58 |
59 | if [ -p /proc/self/fd/1 ]; then
60 | cat
61 | else
62 | xargs -r0 ls -lUdb --color=auto --
63 | fi
64 |
--------------------------------------------------------------------------------
/fslint/findnl:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # findnl - find problematic filenames
4 | # Copyright © 2000-2009 by Pádraig Brady .
5 | #
6 | # This program is free software; you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation; either version 2 of the License, or
9 | # any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 | # See the GNU General Public License for more details,
15 | # which is available at www.gnu.org
16 |
17 |
18 | #Notes:
19 | #note if files have names with ascii char 1 in them will have this converted
20 | #to \n, ls will say file not found in this case and hence the real filename
21 | #can be inferred.
22 | #
23 | #Note expressions are evaluated left to right and as soon as
24 | #one is matched the rest aren't evaluated (makes sense as doing
25 | #or operation not and. Anyway this implies that should check things
26 | #like filename length before actual valid character combinations tests
27 | #
28 | #Don't need to handle ^~ | ^- etc as always get fully qualified path from find
29 | #
30 | #Even if -n1 specified for xargs there will be no ls processes run
31 | #to display output until the end as the pipe is line buffered and
32 | #there is only 1 line passed to xargs. This is required so paths
33 | #with linefeeds are supported.
34 | #
35 | #How do you add expression to only include filenames with @ most
36 | #1 consequtive character (for e.g. :) I was trying: ":{1,1}"
37 | #but the second 1 was ignored? I know grep -Ev ":{2,}" works but
38 | #I need the expression as part of the large expression for obvious
39 | #reasons. For now I'm allowing any filenames with :, but this could
40 | #interoperability problems with NTFS for e.g. which uses this char
41 | #to indicate a seperate stream in the file.
42 | #
43 | #man ascii was useful when writing this.
44 | #
45 | #Hmm just noticed the GNU pathchk utility, which
46 | #should probably be integrated in some way?
47 | #
48 | #Note theoretically the only char UNIX doesn't allow in file/dir names
49 | #is /. This can make things very awkward, especially for future extensions
50 | #like streams etc.
51 |
52 | script_dir=$(dirname "$0") #directory of this script
53 | script_dir=$(readlink -f "$script_dir") #Make sure absolute path
54 |
55 | . "$script_dir"/supprt/fslver
56 |
57 | Usage() {
58 | ProgName=$(basename "$0")
59 | echo "find Name (directory or file) Lint.
60 | Usage: $ProgName [-1] [-2] [-3] [-p] [[-r] [-f] paths(s) ...]
61 |
62 | These options are mutually exclusive (i.e. only the last one takes effect).
63 | -1 is least checking, -3 is most. The default is 2.
64 |
65 | -p is most stringent and applies POSIX.1 filename portability testing.
66 | I.E. characters are limited to [A-Za-z0-9_.-] and max name length = 14 and
67 | max path length = 255.
68 |
69 | If no path(s) specified then the current directory is assumed."
70 | exit
71 | }
72 |
73 | #default settings
74 | level=2
75 | MaxNameLen=129
76 | MaxPathLen=2049
77 |
78 | for arg
79 | do
80 | case "$arg" in
81 | -1)
82 | level="1"
83 | MaxNameLen=256
84 | MaxPathLen=4097 ;;
85 | -2)
86 | : ;; #defaults set above
87 | -3)
88 | level="3"
89 | MaxNameLen=65
90 | MaxPathLen=1025 ;;
91 | -p)
92 | level="p"
93 | MaxNameLen=15
94 | MaxPathLen=256 ;;
95 | -h|--help|-help)
96 | Usage ;;
97 | -v|--version)
98 | Version ;;
99 | *)
100 | if [ -e "$arg" ] && ! echo "$arg" | grep -qF /; then
101 | arg="./$arg" #make sure / before name (see below)
102 | fi
103 | argsToPassOn="$argsToPassOn $(shell_quote "$arg")" ;;
104 | esac
105 | done
106 |
107 | if [ "$level" != "p" ]; then
108 | # Note LC_CTYPE=C in fslver causes grep below to report
109 | # valid UTF8 [:alnum:] chars as problematic, so unset here
110 | unset LC_CTYPE
111 | # Note this slows grep down 320% on FC4 (grep-2.5.1) at least.
112 | # Hence the minimum fslint-gui run time will be about 6 times larger
113 | # due to the polling mechanism it uses.
114 | #else
115 | #I'm trusting grep to process [:alnum:] appropriately
116 | #for the users locale.
117 | fi
118 |
119 | #-p = POSIX.1 checking (names <= 14 chars) etc.
120 | expressionsp="(.*/[^/]{$MaxNameLen,}$)" #name length >= MaxNameLen
121 |
122 | #-1 = min checking(most still only require shell quoting, but very bad practice)
123 | expressions1="$expressionsp|( +$)" #spaces @ end of name
124 | expressions1="$expressions1|(.*/ [^/]*$)" #spaces @ start of name
125 | expressions1="$expressions1|(.*/[^/]*[ ]{2,}[^/]*$)" #2 or more adjacent spaces
126 | expressions1="$expressions1|(.*/-[^/]*$)" #- @ start of name
127 | expressions1="$expressions1|(.*/[^/]* -[^/]*$)" #- after space in name
128 |
129 | #-2 = default checking (characters requiring shell quoting etc)
130 | expressions2="$expressions1|(.*/[^/]*\{[^/]*,[^/]*\}[^/]*$)" #name with {,} pat
131 | expressions2="$expressions2|(.*/[^/]*\[[^/]+\][^/]*$)" #name with [.+] pattern
132 | expressions2="$expressions2|(.*/~[^/]*$)" #~ @ start of name
133 |
134 | #-3 = max checking
135 | expressions3="$expressions2|(.*/[^/]*[.]{2,}[^/]*$)" #2 or more adjacent .'s
136 | expressions3="$expressions3|(.+[.]$)" #trailing .(s)
137 |
138 | charactersp="[:alnum:]_./" #/ included as can't be in name and simpler exprs
139 | characters3="$charactersp,~+"
140 | characters2="$characters3@#!=[{}:;'<>%& "
141 | characters1="$characters2()\"$|\\"
142 | #any other characters are never OK and that includes \t*? etc.
143 | #Note characters ]- are included in expresssions below.
144 |
145 | eval expressions=\$expressions$level
146 | eval characters=\$characters$level
147 |
148 | . "$script_dir"/supprt/getfpf -f "$argsToPassOn"
149 | #forcing -f as expressions assume / before name
150 | #Note could run through basename after if required?
151 |
152 | find -H "$@" -printf "$FPF\0" |
153 | sort -zu | #merge files (indirectly) specified multiple times
154 | tr '\n\0' '\1\n' | #convert \n to \1 so grep works
155 | grep -E "$expressions|(.*/[^/]*[^]$characters-]+[^/]*$)" | #note ] 1st & - last
156 | tr '\n\1' '\0\n' | #convert back from \1 to \n
157 |
158 | if [ ! -p /proc/self/fd/1 ]; then
159 | xargs -r0 ls -b1Ud --color=auto --
160 | else
161 | cat
162 | fi
163 |
--------------------------------------------------------------------------------
/fslint/findns:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # findns - find non stripped executables
4 | # Copyright © 2000-2009 by Pádraig Brady .
5 | #
6 | # This program is free software; you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation; either version 2 of the License, or
9 | # any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 | # See the GNU General Public License for more details,
15 | # which is available at www.gnu.org
16 |
17 |
18 | # Notes:
19 | # Because of limitiation of $(file), files
20 | # with : in name will not be processed correctly
21 | # Also note, don't sort by size before $(file)
22 | # since there will be more seeking over disk and
23 | # therefore will be much slower.
24 |
25 | script_dir=$(dirname "$0") #directory of this script
26 | script_dir=$(readlink -f "$script_dir") #Make sure absolute path
27 |
28 | . "$script_dir"/supprt/fslver
29 |
30 | Usage() {
31 | ProgName=$(basename "$0")
32 | echo "find NonStripped executables.
33 | Usage: $ProgName [[-r] [-f] paths(s) ...]
34 |
35 | If no path(s) specified then the PATH is searched."
36 | exit
37 | }
38 |
39 | if [ $# -eq "0" ] #Nothing on cmdline means search binary directories
40 | then
41 | eval set -- $(. "$script_dir"/supprt/getffp)
42 | FPF="%p"
43 | else
44 | for arg
45 | do
46 | case "$arg" in
47 | -h|--help|-help)
48 | Usage ;;
49 | -v|--version)
50 | Version ;;
51 | *)
52 | argsToPassOn="$argsToPassOn $(shell_quote "$arg")" ;;
53 | esac
54 | done
55 | . "$script_dir"/supprt/getfpf "$argsToPassOn"
56 | fi
57 |
58 | find -H "$@" -type f -perm /111 ! -name "*$LF*" -printf "%i\t$FPF\n" |
59 | sort -u | #merge files (indirectly) specified multiple times
60 | #sorting by inodes runs in 17s for my 2250 binaries
61 | #compared to 20s without
62 | sort -k1,1n | #sort by inodes
63 | cut -f2- |
64 | tr '\n' '\0' |
65 | xargs -r0 file |
66 | # This assumes ':' not in any executable descriptions
67 | sed -n 's/\(.*\):[^:]*executable.* not stripped*/\1/p' |
68 | if [ -p /proc/self/fd/1 ]; then
69 | cat
70 | else
71 | tr '\n' '\0' |
72 | xargs -r0 ls -Ulb -- |
73 | sort -b -k5,5n
74 | fi
75 |
--------------------------------------------------------------------------------
/fslint/findrs:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # findrs - find files that have lines with trailing whitespace
4 | # Copyright © 2000-2009 by Pádraig Brady .
5 | #
6 | # This program is free software; you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation; either version 2 of the License, or
9 | # any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 | # See the GNU General Public License for more details,
15 | # which is available at www.gnu.org
16 |
17 |
18 | # Notes:
19 | #
20 | # Could have option also to flag files that have many consequtive blank lines
21 | # the corresponding regexp would be? "^[ ]*${2,}"
22 |
23 | script_dir=$(dirname "$0") #directory of this script
24 | script_dir=$(readlink -f "$script_dir") #Make sure absolute path
25 |
26 | . "$script_dir"/supprt/fslver
27 |
28 | Usage() {
29 | ProgName=$(basename "$0")
30 | echo "find Redundant whiteSpace.
31 | Usage: $ProgName [-w] [-t[#]] [-c] [[-r] [-f] paths(s) ...]
32 |
33 | -w enables mode to report whitespace at the end of lines.
34 | This is the default mode if none specified.
35 |
36 | -t enables mode to report erroneous mixing of indenting
37 | spaces and tabs (on a single line).
38 | If a number is passed to -t it sets the width of the tabs,
39 | which allows for more thorough checking.
40 |
41 | If -c specified then the number of lines in each file,
42 | with problematic whitespace is reported, in addition
43 | to the file names. Note this will take longer.
44 |
45 | If --view specified then the erroneous whitespace found
46 | is highlighted using vim.
47 |
48 | If no path(s) specified then the current directory is assumed."
49 | exit
50 | }
51 |
52 | #Note in the following grep expression there's a space and tab in []
53 | #and the second [] contains a CR so it works for DOS files
54 | eol='[ ]+[
]*$'
55 |
56 | for arg
57 | do
58 | case "$arg" in
59 | -c)
60 | count="yes" ;;
61 | --view)
62 | view="yes" ;;
63 | -w)
64 | eol_specified="yes" ;;
65 | -t*)
66 | #keep only last 2 digits
67 | ts=$(echo $arg|tr -cd '[:digit:]'|sed 's/^0*//;s/.*\(..\)/\1/')
68 | [ -z "$ts" ] && ts=8 #very rare to have larger than this
69 | at_start='^[ ]*'
70 | tabs="$at_start( | {$ts,})" ;;
71 | -h|--help|-help)
72 | Usage ;;
73 | -v|--version)
74 | Version ;;
75 | *)
76 | argsToPassOn="$argsToPassOn $(shell_quote "$arg")" ;;
77 | esac
78 | done
79 |
80 | if [ -z "$eol_specified" ] && [ "$tabs" ]; then
81 | re="$tabs"
82 | elif [ "$tabs" ] ; then
83 | re="$tabs|$eol"
84 | else
85 | re="$eol"
86 | fi
87 |
88 | . "$script_dir"/supprt/getfpf "$argsToPassOn"
89 |
90 | find -H "$@" -type f -size +0c ! -name "*$LF*" -printf "$FPF\0" |
91 | sort -zu | #merge files (indirectly) specified multiple times
92 | xargs -r0 file |
93 | sed -n 's/\(.*\):[^:]*text.*/\1/p' | #assumes ':' not in desc
94 | tr '\n' '\0' |
95 | if [ "$view" = "yes" ]; then
96 | xargs -r0 grep -nE "$re" |
97 | "$script_dir"/supprt/rmlint/view_ws.sh -
98 | elif [ "$count" = "yes" ]; then
99 | xargs -r0 grep -Ec "$re" |
100 | grep -vE "(:0$|^0$)" |
101 | sort -k2,2nr -t:
102 | else
103 | xargs -r0 grep -El "$re"
104 | fi
105 |
--------------------------------------------------------------------------------
/fslint/findsn:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # findsn - find duplicate names in the specified tree(s).
4 | # Copyright © 2000-2009 by Pádraig Brady .
5 | #
6 | # This program is free software; you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation; either version 2 of the License, or
9 | # any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 | # See the GNU General Public License for more details,
15 | # which is available at www.gnu.org
16 |
17 |
18 | # Notes:
19 | #
20 | # It defaults to looking through the PATH as this
21 | # is usually what you want to check. In this mode
22 | # it has the same functionality as chkdupexe
23 | # (which also has the functionality of checking
24 | # for dangling links that findbl does).
25 | # If you specify paths on the command line,
26 | # then it searches there for duplicate names.
27 | #
28 | # Note unlike the other utils, to look in the current
29 | # directory you must explicitly specify it (using . for
30 | # e.g.)
31 | #
32 | # Note it's not obvious but you don't have to specify
33 | # LC_COLLATE=C anywhere in this script.
34 | #
35 | # Todo: give option to include directory names & or symbolic links
36 | # Todo: give option to exclude links that point to same file
37 |
38 | script_dir=$(dirname "$0") #directory of this script
39 | script_dir=$(readlink -f "$script_dir") #Make sure absolute path
40 |
41 | . "$script_dir"/supprt/fslver
42 |
43 | Usage() {
44 | ProgName=$(basename "$0")
45 | echo "find (files) with duplicate or conflicting names.
46 | Usage: $ProgName [-A -c -C] [[-r] [-f] paths(s) ...]
47 |
48 | If no arguments are supplied the \$PATH is searched for any redundant
49 | or conflicting files.
50 |
51 | -A reports all aliases (soft and hard links) to files.
52 | If no path(s) specified then the \$PATH is searched.
53 |
54 | If only path(s) specified then they are checked for duplicate named
55 | files. You can qualify this with -C to ignore case in this search.
56 | Qualifying with -c is more restrictive as only files (or directories)
57 | in the same directory whose names differ only in case are reported.
58 | I.E. -c will flag files & directories that will conflict if transfered
59 | to a case insensitive file system. Note if -c or -C specified and
60 | no path(s) specifed the current directory is assumed."
61 |
62 | exit
63 | }
64 |
65 | mode="matchFilenames"
66 | uniqsep=prepend
67 |
68 | topipe=no
69 | if [ -p /proc/self/fd/1 ]; then
70 | topipe=yes
71 | fi
72 |
73 | if [ $# -eq "0" ]; then #Nothing on cmdline means search $PATH
74 | mode="path"
75 | eval set -- $(. "$script_dir"/supprt/getffp)
76 | FPF="%p"
77 | elif [ $# -eq "1" ] && [ "$1" = "-A" ]; then
78 | mode="aliases"
79 | eval set -- $(. "$script_dir"/supprt/getffp)
80 | FPF="%p"
81 | else
82 | for arg; do
83 | case "$arg" in
84 | -h|--help|-help)
85 | Usage ;;
86 | -v|--version)
87 | Version ;;
88 | -C)
89 | uniq_ignore_case="-i"
90 | sort_ignore_case="-f" ;;
91 | -c)
92 | mode="casePortability" ;;
93 | -A)
94 | mode="aliases" ;;
95 | *)
96 | argsToPassOn="$argsToPassOn $(shell_quote "$arg")" ;;
97 | esac
98 | done
99 |
100 | if [ $topipe = yes ]; then
101 | . "$script_dir"/supprt/getfpf -f "$argsToPassOn"
102 | else
103 | . "$script_dir"/supprt/getfpf "$argsToPassOn"
104 | fi
105 | fi
106 |
107 | check_uniq
108 |
109 | translate()
110 | {
111 | case "$1" in
112 | safe) #change problem chars
113 | tr ' \t\n\1\0' '\2\3\4 \n' ;;
114 | safe2pipe)
115 | tr '\2\3\4\n' ' \t\n\0' ;;
116 | safe2human)
117 | tr '\2\3\4' ' \t\n' ;;
118 | esac
119 | }
120 |
121 | auto_ignore_paths()
122 | {
123 | echo "-true"
124 | #ignore common $PATH dependent programs
125 | echo "
126 | /usr/bin/ccache
127 | /usr/bin/consolehelper
128 | /usr/sbin/lvm
129 | /sbin/lvm.static
130 | " | sed '/ *#/d; /^ *$/d' | #remove comments and blank lines
131 | while read path; do
132 | inode=$(find "$path" -printf "%i" 2>/dev/null)
133 | [ "$inode" ] && echo -n " -and ! -inum $inode"
134 | done
135 | }
136 |
137 | case "$mode" in
138 |
139 | casePortability)
140 | find -H "$@" \( -type d -o -type f \) -printf "%f\1$FPF\1%h\0" |
141 | sort -zu | #merge files (indirectly) specified multiple times
142 | translate safe |
143 | sort -b -k3,3 -k1,1f | #group paths (case sens), then names (case insens)
144 | uniq -2 -D |
145 | uniq -i --all-repeated=$uniqsep |
146 | cut -f2 -d' ' ;;
147 | matchFilenames)
148 | find -H "$@" -type f -printf "$FPF\1%f\0" |
149 | sort -zu | #merge files (indirectly) specified multiple times
150 | translate safe |
151 | sort $sort_ignore_case -k2,2 |
152 | uniq --all-repeated=$uniqsep -1 $uniq_ignore_case ;;
153 | path)
154 |
155 | find "$@" \( -type f -o -type l \) -follow \( $(auto_ignore_paths) \) \
156 | -printf "$FPF\1%i\1%f\0" |
157 | sort -zu | #merge files (indirectly) specified multiple times
158 | translate safe |
159 | sort -k3,3 -k2,2n |
160 | uniq -D -2 |
161 | uniq -1 |
162 | uniq --all-repeated=$uniqsep -2 ;;
163 | aliases)
164 | find "$@" \( -type f -o -type l \) -follow -printf "$FPF\1%i\0" |
165 | sort -zu | #merge files (indirectly) specified multiple times
166 | translate safe |
167 | sort -k2,2n |
168 | uniq --all-repeated=$uniqsep -1 ;;
169 | esac |
170 | cut -f1 -d' ' |
171 | if [ $topipe = yes ]; then
172 | translate safe2pipe
173 | else
174 | #one can change this block to "translate safe2human" for grouped output
175 | #Alternatively you can pipe output to "tr '\0' '\n'"
176 | sed '/^ *$/d' |
177 | translate safe2pipe |
178 | xargs -r0 ls -lbUd --color=auto --
179 | fi
180 |
--------------------------------------------------------------------------------
/fslint/findtf:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # findtf - find temporary files
4 | # Copyright © 2000-2009 by Pádraig Brady .
5 | #
6 | # This program is free software; you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation; either version 2 of the License, or
9 | # any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 | # See the GNU General Public License for more details,
15 | # which is available at www.gnu.org
16 |
17 | script_dir=$(dirname "$0") #directory of this script
18 | script_dir=$(readlink -f "$script_dir") #Make sure absolute path
19 |
20 | . "$script_dir"/supprt/fslver
21 |
22 | Usage() {
23 | ProgName=$(basename "$0")
24 | echo "find Temporary Files.
25 | Usage: $ProgName [-c] [--age=days] [[-r] [-f] paths(s) ...]
26 |
27 | If -c specified then a more thorough search is done for
28 | (and only for) core files, and more information is printed about them.
29 |
30 | If --age=days specified then the temporary files must be over that
31 | number of \"days\" old before being reported.
32 | For e.g. findtf -c --age=4 only reports core files over 4 days old.
33 |
34 | If no path(s) specified then the current directory is assumed."
35 | exit
36 | }
37 |
38 | MIN_AGE=0 #days
39 |
40 | for arg
41 | do
42 | case "$arg" in
43 | -h|--help|-help)
44 | Usage ;;
45 | -v|--version)
46 | Version ;;
47 | --age=*)
48 | days=$(echo $arg | cut -b7-)
49 | [ "$days" ] && MIN_AGE=$days ;;
50 | -c)
51 | core_mode="yes" ;;
52 | *)
53 | argsToPassOn="$argsToPassOn $(shell_quote "$arg")" ;;
54 | esac
55 | done
56 |
57 | if [ "$MIN_AGE" != "0" ]; then
58 | FIND_AGE="-mtime +$MIN_AGE"
59 | fi
60 |
61 | if [ "$force_full" = "yes" ]; then
62 | . "$script_dir"/supprt/getfpf -f "$argsToPassOn"
63 | else
64 | . "$script_dir"/supprt/getfpf "$argsToPassOn"
65 | fi
66 |
67 | if [ "$core_mode" = "yes" ]; then
68 | find -H "$@" -type f -name "*core*" $FIND_AGE ! -name "*$LF*" \
69 | -printf "%p\n" |
70 | grep -E "/core$|\.core$|/core\.[0-9]+$" |
71 | xargs -r file |
72 | grep -F "core file " |
73 | if [ -p /proc/self/fd/1 ]; then
74 | cut -f1 -d: #only leave filename
75 | else
76 | cat
77 | fi
78 | exit
79 | fi
80 |
81 | # .v are rcs files
82 | # .swp are vi backup files are shouldn't be removed really?
83 | # Hrm well vi doesn't delete after restore?
84 | # dead.letter generated by pine and sendmail I think
85 | # #*# & *~ are EMACS
86 | # *.pure is purify remains
87 |
88 | tmpFiles="core dead.letter '*~' ',*' '*.v' tmp junk '\#*' \
89 | '.emacs_[0-9]*' '*.[Bb][Aa][Kk]' '*.swp' '*.pure'"
90 |
91 | # build "find" command line
92 | Names=
93 | for name in $tmpFiles
94 | do
95 | [ -n "$Names" ] && Names="$Names -o "
96 | Names="${Names}-name $name"
97 | done
98 | Names="\( $Names \)"
99 |
100 | eval find -H '"$@"' -type f $Names $FIND_AGE -printf "$FPF'\0'" |
101 | sort -zu | #merge files (indirectly) specified multiple times
102 | tr '\0' '\n'
103 |
--------------------------------------------------------------------------------
/fslint/findu8:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # findu8 - find files with invalid utf8 names
4 | # Copyright © 2000-2009 by Pádraig Brady .
5 | #
6 | # This program is free software; you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation; either version 2 of the License, or
9 | # any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 | # See the GNU General Public License for more details,
15 | # which is available at www.gnu.org
16 |
17 |
18 | # Notes:
19 | #
20 | # This is slow as it starts an iconv process per file,
21 | # but it mitigates this by filtering out ascii only names beforehand.
22 |
23 | script_dir=$(dirname "$0") #directory of this script
24 | script_dir=$(readlink -f "$script_dir") #Make sure absolute path
25 |
26 | . "$script_dir"/supprt/fslver
27 |
28 | Usage() {
29 | ProgName=$(basename "$0")
30 | echo "find names with invalid UTF8 encoding.
31 | Usage: $ProgName [[-r] [-f] paths(s) ...]
32 |
33 | If no path(s) specified then the current directory is assumed."
34 | exit
35 | }
36 |
37 | for arg
38 | do
39 | case "$arg" in
40 | -h|--help|-help)
41 | Usage ;;
42 | -v|--version)
43 | Version ;;
44 | *)
45 | argsToPassOn="$argsToPassOn $(shell_quote "$arg")" ;;
46 | esac
47 | done
48 |
49 | . "$script_dir"/supprt/getfpf "$argsToPassOn"
50 |
51 | find -H "$@" -printf "$FPF\0" |
52 | sort -zu | #merge files (indirectly) specified multiple times
53 | tr '\n\0' '\1\n' | #convert \n to \1 so grep works
54 | LANG=C grep -E '[^ -~]' | #filter out purely ASCII names
55 | while read; do
56 | name="$REPLY"
57 | echo "$name" | iconv --from=utf8 --to=utf8 >/dev/null 2>&1 || echo "$name"
58 | done |
59 | tr '\n\1' '\0\n' | #convert back from \1 to \n
60 | if [ ! -p /proc/self/fd/1 ]; then
61 | xargs -r0 ls -b1Ud --color=auto --
62 | else
63 | cat
64 | fi
65 |
--------------------------------------------------------------------------------
/fslint/findul:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # findu8 - find un{used,referenced} libraries on the system
4 | # Copyright © 2000-2009 by Pádraig Brady .
5 | #
6 | # This program is free software; you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation; either version 2 of the License, or
9 | # any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 | # See the GNU General Public License for more details,
15 | # which is available at www.gnu.org
16 |
17 | script_dir=$(dirname "$0") #directory of this script
18 | script_dir=$(readlink -f "$script_dir") #Make sure absolute path
19 |
20 | . "$script_dir"/supprt/fslver
21 |
22 | Usage() {
23 | ProgName=$(basename "$0")
24 | echo "Find possible redundant (Unused) Libraries.
25 | Usage: $ProgName
26 |
27 | Note BE SURE you know a library is not needed before deleting it.
28 | For e.g. this tool doesn't recognise libraries that are only referenced
29 | at runtime (for e.g. plugins)."
30 |
31 | exit
32 | }
33 |
34 | # let's use TMPDIR if it's defined...
35 | TMP=${TMPDIR:-/tmp}
36 |
37 | trap 'rm -f $TMP/all_libs $TMP/all_used_libs $TMP/unused_and_referenced_libs \
38 | > /dev/null 2>&1' 0
39 | trap "exit 2" 1 2 3 15
40 |
41 | for arg
42 | do
43 | case "$arg" in
44 | -h|--help|-help)
45 | Usage ;;
46 | -v|--version)
47 | Version ;;
48 | *)
49 | Usage ;;
50 | esac
51 | done
52 |
53 |
54 | # let's remove this file, just in case it's a symlink pointing to
55 | # /lib/ld-linux.so.2 or something...
56 | rm -f "$TMP/all_libs"
57 | lib_dirs=$(. "$script_dir"/supprt/getffl)
58 | find $lib_dirs -type f -follow -name '*.so*' -printf '%p\t%i\n' |
59 | sort -k2,2n |
60 | uniq -f1 > "$TMP/all_libs"
61 |
62 | # let's remove this file, just in case it's a symlink pointing to
63 | # /lib/ld-linux.so.2 or something...
64 | rm -f "$TMP/all_used_libs"
65 | find $(. "$script_dir"/supprt/getffp) -xdev -type f -perm /111 |
66 | xargs ldd |
67 | cut -s -f3 -d' ' |
68 | grep -F / |
69 | sort |
70 | uniq |
71 | xargs -i find {} -follow -printf '%p\t%i\n' |
72 | sort -k2,2n |
73 | uniq -f1 > "$TMP/all_used_libs"
74 |
75 | # let's remove this file, just in case it's a symlink pointing to
76 | # /lib/ld-linux.so.2 or something...
77 | rm -f "$TMP/unused_and_referenced_libs"
78 | cat "$TMP/all_libs" "$TMP/all_used_libs" |
79 | sort -k2,2n -u > "$TMP/unused_and_referenced_libs"
80 |
81 | cat "$TMP/all_used_libs" "$TMP/unused_and_referenced_libs" |
82 | sort -k2,2n |
83 | uniq -u -f1 |
84 | cut -f1 |
85 | sort |
86 | if [ ! -p /proc/self/fd/1 ]; then
87 | xargs -r ls -lUb --color=auto --
88 | else
89 | cat
90 | fi
91 |
--------------------------------------------------------------------------------
/fslint/findup:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # findup - find duplicate files
4 | # Copyright © 2000-2017 by Pádraig Brady .
5 | #
6 | # This program is free software; you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation; either version 2 of the License, or
9 | # any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 | # See the GNU General Public License for more details,
15 | # which is available at www.gnu.org
16 |
17 |
18 | # Description
19 | #
20 | # will show duplicate files in the specified directories
21 | # (and their subdirectories), in the format:
22 | #
23 | # file1
24 | # file2
25 | #
26 | # file3
27 | # file4
28 | # file5
29 | #
30 | # or if the --summary option is specified:
31 | #
32 | # 2 * 2048 file1 file2
33 | # 3 * 1024 file3 file4 file5
34 | #
35 | # Where the number is the disk usage in bytes of each of the
36 | # duplicate files on that line, and all duplicate files are
37 | # shown on the same line.
38 | # Output it ordered by largest disk usage first and
39 | # then by the number of duplicate files.
40 | #
41 | # Caveats/Notes:
42 | # I compared this to any equivalent utils I could find (as of Nov 2000)
43 | # and it's (by far) the fastest, has the most functionality (thanks to
44 | # find) and has no (known) bugs. In my opinion fdupes is the next best but
45 | # is slower (even though written in C), and has a bug where hard links
46 | # in different directories are reported as duplicates sometimes.
47 | #
48 | # This script requires uniq > V2.0.21 (part of GNU textutils|coreutils)
49 | # dir/file names containing \n are ignored
50 | # undefined operation for dir/file names containing \1
51 | # sparse files are not treated differently.
52 | # Don't specify params to find that affect output etc. (e.g -printf etc.)
53 | # symbolic links are ignored.
54 | # path1 & path2 can be files and/or directories
55 |
56 | script_dir=$(dirname "$0") #directory of this script
57 | script_dir=$(readlink -f "$script_dir") #Make sure absolute path
58 |
59 | . "$script_dir"/supprt/fslver
60 |
61 | Usage() {
62 | ProgName=$(basename "$0")
63 | echo "find dUPlicate files.
64 | Usage: $ProgName [[[-t [-m|-d]] | [--summary]] [-r] [-f] paths(s) ...]
65 |
66 | If no path(s) specified then the current directory is assumed.
67 |
68 |
69 | When -m is specified any found duplicates will be merged (using hardlinks).
70 | When -s is specified any found duplicates will be replaced (using symlinks).
71 | When -d is specified any found duplicates will be deleted (leaving just 1).
72 | When -t is specfied, only report what -m or -d would do.
73 |
74 | When --summary is specified change output format to include file sizes.
75 | You can also pipe this summary format to "$script_dir"/fstool/dupwaste
76 | to get a total of the wastage due to duplicates.
77 |
78 | Examples:
79 |
80 | search for duplicates in current directory and below
81 | findup or findup .
82 | search for duplicates in all linux source directories and merge using hardlinks
83 | findup -m /usr/src/linux*
84 | same as above but don't look in subdirectories
85 | findup -r .
86 | search for duplicates in /usr/bin
87 | findup /usr/bin
88 | search in multiple directories but not their subdirectories
89 | findup -r /usr/bin /bin /usr/sbin /sbin
90 | search for duplicates in \$PATH
91 | findup \$("$script_dir"/supprt/getffp)
92 | exclude zero length files from the search
93 | findup / -size +0c
94 | search system for duplicate files over 100K in size
95 | findup / -size +100k
96 | search only my files (that I own and are in my home dir)
97 | findup ~ -user \$(id -u)
98 | search system for duplicate files belonging to roger
99 | findup / -user \$(id -u roger)"
100 | exit
101 | }
102 |
103 | cleanup_sum() {
104 |
105 | sed '
106 | # md5sum and sha1sum et. al. from coreutils at least,
107 | # to deal with \n in filenames, convert any \ and \n chars
108 | # to \\ and \\n respectively. Currently we ignore files with \n
109 | # so just undo this problematic escaping
110 | /^\\/{s/.//; s/\\\\/\\/g};
111 |
112 | # These utils also add a "*" flag character for normal files
113 | # on platforms where O_BINARY is significant (like CYGWIN).
114 | # We always process in binary mode and so remove that flag here
115 | s/^\([^ ]*\) \*/\1 /;
116 | '
117 | }
118 |
119 | for arg
120 | do
121 | case "$arg" in
122 | -h|--help|-help)
123 | Usage ;;
124 | -v|--version)
125 | Version ;;
126 | --summary)
127 | mode="summary" ;;
128 | --gui)
129 | # Undocumented option to avoid extra
130 | # hardlink merging already done in GUI
131 | gui=1 ;;
132 | -m)
133 | mode="merge" ;;
134 | -d)
135 | mode="del" ;;
136 | -s)
137 | mode="symlink" ;;
138 | -t)
139 | t="t" ;;
140 | *)
141 | argsToPassOn="$argsToPassOn $(shell_quote "$arg")" ;;
142 | esac
143 | done
144 |
145 | sep_mode="separate"
146 |
147 | if [ "$mode" = "summary" ]; then
148 | #Don't do extra hardlink processing.
149 | #This speeds things up, and also removes the python dependency
150 | merge_early="-u"
151 | fi
152 |
153 | . "$script_dir"/supprt/getfpf "$argsToPassOn"
154 |
155 | check_uniq
156 |
157 | dev_id="$(find /bin/sh -printf '%D' 2>/dev/null)"
158 | if [ "$dev_id" = "D" ] || [ ! "$dev_id" ]; then
159 | devFmt="\060" #0
160 | else
161 | devFmt=%D #This is new in findutils-4.2 and will help find more duplicates
162 | fi
163 |
164 | #print name, dev, inode & size.
165 | find -H "$@" -type f ! -name "*$LF*" -printf "$FPF\0$devFmt\0%i\0%s\n" |
166 | sort -u | #merge files (indirectly) specified multiple times
167 | tr ' \t\0' '\0\1 ' | #remove spaces, tabs in file names
168 | sort -k4,4nr -k2,2n -k3,3 $merge_early |#group [and merge] size,dev & inodes
169 | if [ -z "$merge_early" ]; then
170 | "$script_dir"/supprt/rmlint/merge_hardlinks
171 | else
172 | uniq -3 -D #pick just duplicate filesizes
173 | fi |
174 | sort -k2,2n -k3,3n | #NB sort inodes so md5sum does less seeking all over disk
175 | cut -f1 -d' ' -s | #get filenames to work on
176 | tr '\0\1\n' ' \t\0' |#reset any space & tabs etc and delimit names with \0
177 |
178 | # The following optional block, md5sums a small sample of each file,
179 | # which can help when there are many files of the same size,
180 | # even more so if they are large. This usually adds a small amount of
181 | # runtime, however it can save a large amount of time in certain situations.
182 | if "$script_dir"/supprt/md5sum_approx /dev/null; then
183 | xargs -r0 "$script_dir"/supprt/md5sum_approx |
184 | sort | #group duplicate files together
185 | uniq --all-repeated -w32 | #pick just duplicates
186 | cut -d' ' -f3- | #get filenames
187 | sort | #sort by paths to try to minimise disk seeks
188 | tr '\n' '\0' #delimit names with \0
189 | else
190 | cat
191 | fi |
192 |
193 | # This block selects duplicates using md5sum of whole file
194 | xargs -r0 md5sum -- | #calculate md5sums for possible duplicates
195 | cleanup_sum | #undo any backslash escaping
196 | sort | #group duplicate files together
197 | uniq --all-repeated=$sep_mode -w32 | #pick just duplicates
198 |
199 | # The following optional block, checks duplicates again using sha1
200 | # Note for data sets that don't totally fit in cache this will
201 | # probably read duplicate files off the disk again.
202 | cut -s -d' ' -f3- | #get filenames
203 | sort | #sort by paths to try to minimise disk seeks
204 | tr '\n' '\0' | #delimit names with \0
205 | xargs -r0 sha1sum -- | #to be sure to be sure
206 | cleanup_sum | #undo any backslash escaping
207 | sort | #group duplicate files together
208 | uniq --all-repeated=$sep_mode -w40 | #pick just duplicates
209 |
210 | cut -d' ' -f3- | #get filenames (and leave separating lines)
211 |
212 | if [ "$gui" ]; then
213 | # GUI already does similar processing for accurate disk usage reporting
214 | cat
215 | elif [ "$mode" ]; then
216 |
217 | # exclude already fully hardlinked duplicate groups
218 | "$script_dir"/supprt/rmlint/merge_hardlinks --non-gui |
219 |
220 | if [ ! $mode = "summary" ]; then # external call to python as this is faster
221 | if "$script_dir"/supprt/rmlint/fixdup /dev/null; then
222 | "$script_dir"/supprt/rmlint/fixdup $t$mode
223 | elif "$script_dir"/supprt/rmlint/fixdup.sh /dev/null; then
224 | "$script_dir"/supprt/rmlint/fixdup.sh $t$mode
225 | else
226 | echo "Error, couldn't execute merge util" >&2
227 | exit 1
228 | fi
229 | else
230 | (
231 | line=''
232 | declare -i counter #Use bash arithmetic, not expr (for speed)
233 | counter=0
234 | while read; do
235 | # note we dont specify "file" to `read`
236 | # as otherwise trailing IFS will be stripped
237 | file="$REPLY"
238 | if [ ! "$file" ]; then
239 | if [ ! -z "$line" ]; then
240 | echo "$counter * $line"
241 | fi
242 | counter=0
243 | else
244 | if [ $counter -eq 0 ]; then
245 | line=$(du -B1 "$file")
246 | else
247 | line="$line $file"
248 | fi
249 | counter=counter+1
250 | fi
251 | done
252 |
253 | if [ ! -z "$line" ]; then
254 | echo "$counter * $line"
255 | fi
256 | ) |
257 | sort -k3,3 -k1,1 -brn
258 | fi
259 | else
260 | # exclude already fully hardlinked duplicate groups
261 | "$script_dir"/supprt/rmlint/merge_hardlinks --non-gui
262 | fi
263 |
--------------------------------------------------------------------------------
/fslint/fslint:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # fslint - FSlint command line utilites wrapper
4 | # Copyright © 2000-2007 by Pádraig Brady .
5 | #
6 | # This program is free software; you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation; either version 2 of the License, or
9 | # any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 | # See the GNU General Public License for more details,
15 | # which is available at www.gnu.org
16 |
17 |
18 | # Notes:
19 | #
20 | # This is just a simple wrapper for the various commands.
21 | # This assumes all commands are in same dir.
22 |
23 | script_dir=$(dirname "$0") #directory of this script
24 | script_dir=$(readlink -f "$script_dir") #Make sure absolute path
25 |
26 | . "$script_dir"/supprt/fslver
27 |
28 | Usage() {
29 | ProgName=$(basename "$0")
30 | echo "File system lint.
31 | A collection of utilities to find lint on a filesystem.
32 | To get more info on each utility run 'util --help'.
33 |
34 | findup -- find DUPlicate files
35 | findnl -- find Name Lint (problems with filenames)
36 | findu8 -- find filenames with invalid utf8 encoding
37 | findbl -- find Bad Links (various problems with symlinks)
38 | findsn -- find Same Name (problems with clashing names)
39 | finded -- find Empty Directories
40 | findid -- find files with dead user IDs
41 | findns -- find Non Stripped executables
42 | findrs -- find Redundant Whitespace in files
43 | findtf -- find Temporary Files
44 | findul -- find possibly Unused Libraries
45 | zipdir -- Reclaim wasted space in ext2 directory entries"
46 | exit
47 | }
48 |
49 | for arg
50 | do
51 | case "$arg" in
52 | -h|--help|-help)
53 | Usage ;;
54 | -v|--version)
55 | Version ;;
56 | esac
57 | done
58 |
59 | echo "-----------------------------------file name lint"
60 | "$script_dir"/findnl "$@"
61 | echo "-------------------------------Invalid utf8 names"
62 | "$script_dir"/findu8 "$@"
63 | echo "-----------------------------------file case lint"
64 | "$script_dir"/findsn -c "$@"
65 | echo "----------------------------------DUPlicate files"
66 | "$script_dir"/findup "$@"
67 | echo "-----------------------------------Dangling links"
68 | "$script_dir"/findbl "$@"
69 | echo "--------------------redundant characters in links"
70 | "$script_dir"/findbl -n "$@"
71 | echo "------------------------------------suspect links"
72 | "$script_dir"/findbl -s "$@"
73 | echo "--------------------------------Empty Directories"
74 | "$script_dir"/finded "$@"
75 | echo "----------------------------------Temporary Files"
76 | "$script_dir"/findtf "$@"
77 | echo "----------------------duplicate/conflicting Names"
78 | if [ "$1" = "/" ]; then
79 | "$script_dir"/findsn
80 | else
81 | "$script_dir"/findsn "$@"
82 | fi
83 | echo "------------------------------------------Bad ids"
84 | "$script_dir"/findid "$@"
85 | echo "-------------------------Non Stripped executables"
86 | if [ "$1" = "/" ]; then
87 | "$script_dir"/findns
88 | else
89 | "$script_dir"/findns "$@"
90 | fi
91 |
--------------------------------------------------------------------------------
/fslint/fstool/dir_size:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | dir=${*-.}
3 | du -all -b --max-depth=1 $dir --exclude=$dir | sort -k1,1nr
4 |
--------------------------------------------------------------------------------
/fslint/fstool/dupwaste:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python2
2 |
3 | # This script shows the total space wasted by duplicate files
4 | # as reported by findup (pipe `findup --summary`to this).
5 | #
6 | # This script can take in two arguments.
7 | # --help prints the command usage.
8 | # --human calculates the output size in KB, MB, GB, or TB.
9 |
10 | import sys
11 | import getopt
12 | import locale
13 |
14 | def sizes():
15 | for line in sys.stdin:
16 | (num, mul, size, rest) = line.split(None,3)
17 | num=int(num)
18 | size=int(size)
19 | num -= 1
20 | size *= num
21 | yield size
22 |
23 | def human_num(num, divisor=1, power=""):
24 | num=float(num)
25 | if divisor == 1:
26 | return locale.format("%.f",num,1)
27 | elif divisor == 1000:
28 | powers=[" ","K","M","G","T","P"]
29 | elif divisor == 1024:
30 | powers=[" ","Ki","Mi","Gi","Ti","Pi"]
31 | else:
32 | raise ValueError("Invalid divisor")
33 | if not power: power=powers[0]
34 | while num >= 1000: #4 digits
35 | num /= divisor
36 | power=powers[powers.index(power)+1]
37 | if power.strip():
38 | num = locale.format("%6.1f",num,1)
39 | else:
40 | num = locale.format("%4.f",num,1)+' '
41 | return "%s%s" % (num,power)
42 |
43 | def Usage():
44 | print "Print the total wasted space given output from `findup --summary`"
45 | print
46 | print "--human print the total in human readable form."
47 | print "--help print this information."
48 |
49 |
50 | # The start of the program
51 | # Catching arguments in the order of importance
52 | #
53 | # The help should be the first and only argument parsed and run even if
54 | # the user wants to pass in multiple options. As long as one of these strings
55 | # are passed in, the help function runs.
56 | #
57 | # Using the same function as found in fslint-gui just to maintain code
58 | # similarity throughout the project as best I can.
59 | try:
60 | lOpts, lArgs = getopt.getopt(sys.argv[1:], "", ["help","human"])
61 | if ("--help","") in lOpts:
62 | Usage()
63 | sys.exit(None)
64 | # See the resize function for more details about the output.
65 | elif ("--human","") in lOpts:
66 | print "Total wasted space: %sB" % human_num(sum(sizes()), divisor=1024)
67 | # No options get the default bytes.
68 | else:
69 | print "Total wasted space: %d bytes" % sum(sizes())
70 | except getopt.error as msg:
71 | print msg
72 | Usage()
73 | sys.exit(1)
74 |
--------------------------------------------------------------------------------
/fslint/fstool/edu:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | find "$@" -maxdepth 1 -mindepth 1 \( -type f -o -type l \) -print0 |
4 | xargs -r0 du -b --max-depth 0 |
5 | sort -k1,1n |
6 | grep -v "^0" |
7 | while read size file; do
8 | printf "%'d\t\t%s\n" $size $file
9 | done
10 |
--------------------------------------------------------------------------------
/fslint/fstool/lS:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #Hmm noticed that ls V 4.01 has a -Sr option that does the same
3 | #as this (directories are listed though). It's kinda bad actually
4 | #since ls should just be listing files and other utils should
5 | #sort and format etc. Hmm.. Also ls still groups files in each directory
6 | #and doesn't group files together.
7 |
8 | #Note the following simpler command is not 100% correct as
9 | #you need ls on end of pipe to do --color=auto appropriately.
10 | #(BTW shouldn't --color default to --color=auto rather than --color=always ?)
11 | # ls --color -l -U -A ${*-.} | grep -e "^d" -v | sort +4n
12 |
13 | #Note instead of doing `-type f -or -type l` in the find command
14 | #below one could have done:
15 | #{
16 | # find ${*-.} -type l -maxdepth 1 -printf "%s $findPathFormat\n"
17 | # find ${*-.} -type f -maxdepth 1 -printf "%s $findPathFormat\n"
18 | #} |
19 | #This obviously more inefficient in this case but the construct
20 | #could be very useful in certain situations.
21 | #Note I'm checking for symbolic links also as these are "real files"
22 | #and so have space allocated. (Note on ext2 if they're less than 60 bytes
23 | #they don't use space. Reiser does this for all (parts of) files less
24 | #than 1 block).
25 |
26 | if [ -d "$1" ]; then
27 | dir="$1"
28 | cd "$dir"
29 | else
30 | dir="."
31 | fi
32 |
33 | find $dir -maxdepth 1 \( -type l -or -type f \) -printf "%s\t%P\n" |
34 | sort -k1,1n |
35 | cut -s -f2- |
36 | tr '\n' '\0' |
37 | xargs -r0 ls -lU --color=auto --
38 |
--------------------------------------------------------------------------------
/fslint/supprt/fslver:
--------------------------------------------------------------------------------
1 | # Exit early if there is an error
2 | set -e
3 |
4 | # Store \n in a variable for use in scripts
5 | LF='
6 | '
7 |
8 | # Quote a parameter for safe interpretation by shell
9 | shell_quote() {
10 | # bash has printf %q for this
11 | printf '"'
12 | echo -n "$*" | sed 's/\([`"$\]\)/\\\1/g'
13 | printf '"'
14 | }
15 |
16 | # The following is essentially to speedup sort & grep
17 | # (which redhat really crippled speedwise around redhat 8/9 for UTF8 locales).
18 | # Note since glibc 2.3.3 this causes (error) messages from
19 | # subordinate tools to not use the charset in LC_MESSAGES.
20 | # (see `info libc "Charset conversion in gettext"`).
21 | export LC_CTYPE=C #uncomment for speed (noting the caveats above)
22 | export LC_COLLATE=C #for even more speed
23 |
24 | # I noticed Fedora 7 was much slower than FC4 for grep.
25 | # The following change restores the faster operation.
26 | # Also DFA seems more correct wrt multibyte input?
27 | # https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=121313
28 | export GREP_USE_DFA=1
29 |
30 | Version() {
31 | echo "FSlint 2.47" && exit
32 | }
33 |
34 | check_uniq() {
35 | #This uniq feature is very new (9/9/02) so check explicitly
36 | echo | uniq --all-repeated=prepend > /dev/null 2>&1 || \
37 | { echo "Error: uniq must have --all-repeated=prepend option. \
38 | Get the latest version from GNU coreutils or textutils-2.0.21" >&2; exit 1; }
39 | }
40 |
--------------------------------------------------------------------------------
/fslint/supprt/getffl:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # output $LIBRARY directories in format that find requires
4 |
5 | #Note if you've a link to a dir (for e.g /usr/bin/X11), then general unix way to
6 | #specify the directory rather than the link is to make sure there's a trailing /
7 | #Therefore I append / to every dir just in case.
8 |
9 | if [ "x$1" != "x-justPATH" ]; then
10 | #Note $PERMPATH defines common lib directories.
11 | PERMPATH="/lib /usr/lib /usr/local/lib"
12 | fi
13 | CURRPATH=`cat /etc/ld.so.conf`
14 | LIB_PATH=`echo $LD_LIBRARY_PATH | tr : '\n' | sed -e '/^$/d'`
15 |
16 | find $PERMPATH $CURRPATH $LIB_PATH -type d -maxdepth 0 -follow \
17 | -printf "%p\t%i\n" 2>/dev/null |
18 | sort -k2,2n -u | #remove duplicate dirs in $PATH (even if diff names/links)
19 | cut -f1 |
20 | tr '\n' : |
21 | sed 's|:|/ |g' |
22 | tr -s /
23 | echo "-maxdepth 1"
24 |
--------------------------------------------------------------------------------
/fslint/supprt/getffp:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # output $PATH in format that find requires
4 |
5 | #Note if you've a link to a dir (for e.g /usr/bin/X11), then general unix way to
6 | #specify the directory rather than the link is to make sure there's a trailing /
7 | #Therefore I append / to every dir just in case.
8 |
9 | #caveats. $PATH can't contain spaces or tabs
10 |
11 | if [ "x$1" != "x-justPATH" ]; then
12 | #Note $PERMPATH defines common binary directories. Any others specific
13 | #to your $PATH will be automatically picked up. If there are directories
14 | #not in your $PATH you want to check, then add them to $PERMPATH
15 | PERMPATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:
16 | /usr/X11R6/bin:/usr/TeX/bin:/usr/tex/bin:/usr/games:/usr/local/games:"
17 | fi
18 |
19 | FINDDIRS=`echo $PERMPATH$PATH | tr : '\n' | sed -e '/^$/d'`
20 | find $FINDDIRS -type d -maxdepth 0 -follow -printf "%p\t%i\n" 2>/dev/null |
21 | sort -k2,2n -u | #remove duplicate dirs in $PATH (even if diff names/links)
22 | cut -f1 |
23 | tr '\n' : |
24 | sed 's|:|/ |g' |
25 | tr -s /
26 | echo "-maxdepth 1"
27 |
--------------------------------------------------------------------------------
/fslint/supprt/getfpf:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | # This is not meant to be called directly!
3 | #
4 | # getfpf = get Find Path Format
5 | #
6 | # This script is used to get the correct find format for
7 | # ls etc. I.E. whether full path needs to be returned
8 | # or just the basename
9 | #
10 | # Usage: . getfpf $@
11 | # Also must do set -f before calling this
12 | # as this doesn't work correctly with filename globbing
13 | #
14 | # Returns: printf format in $FPF (Find Path format)
15 | # find parameters in "$@"
16 | #
17 | # TODO: Have option when 1 dir specified
18 | # which is not . or ./ or ./././. (use basename
19 | # to reduce all these to .) then %p returned
20 |
21 | num_files=0
22 | files=
23 | switches=
24 | onfindswitches=false
25 | forcefullpath=false
26 |
27 | eval set -- "$@"
28 | for arg in "$@";
29 | do
30 | case "$arg" in
31 | -r) #turn OFF recursion
32 | switches="$switches -maxdepth 1" ;;
33 | #don't say onfindswitches=true since want to allow -r before paths
34 | -f) #force full paths even if only 1 specified
35 | forcefullpath=true ;;
36 | -*|\(|\)|!) #pass other switches onto find
37 | switches="$switches '$arg'"
38 | onfindswitches=true ;;
39 | *)
40 | if [ "$onfindswitches" = "true" ]; then
41 | switches="$switches $(shell_quote "$arg")"
42 | else
43 | num_files=`expr $num_files + 1`
44 | if [ -z "$files" ]; then
45 | files="$(shell_quote "$arg")"
46 | else
47 | files="$files $(shell_quote "$arg")"
48 | fi
49 | fi ;;
50 | esac
51 | done
52 |
53 | if [ $num_files -gt 1 ]; then
54 | FPF="%p"
55 | findArgs="$files $switches"
56 | else
57 | if [ $forcefullpath = "true" ]; then
58 | findArgs="$files $switches"
59 | FPF="%p"
60 | else
61 | findArgs="$switches"
62 | FPF="%P"
63 |
64 | if [ $num_files -eq 1 ]; then #only cd if path specified
65 | findArgs="$files $switches"
66 | eval files=$files #remove quotes
67 | if [ -d "$files" ]; then
68 | cd "$files"
69 | findArgs="$switches"
70 | else
71 | FPF="%p"
72 | fi
73 | fi
74 | fi
75 | fi
76 | eval set -- "$findArgs"
77 |
--------------------------------------------------------------------------------
/fslint/supprt/md5sum_approx:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python2
2 |
3 | # md5sum CHUNK_SIZE bytes of file
4 |
5 | CHUNK_SIZE=512 #4096 for full file
6 |
7 | # Note this takes 60% more CPU than md5sum on FC4 at least,
8 | # when checksumming the whole file.
9 | # On F7 I retested it takes around 20% more CPU.
10 |
11 | #TODO: see how kernel readahead affects this
12 |
13 | import os,sys,errno
14 |
15 | import locale
16 | try:
17 | locale.setlocale(locale.LC_ALL,'')
18 | except:
19 | pass
20 |
21 | try:
22 | # md5 module is deprecated on python 2.6
23 | # so try the newer hashlib first
24 | import hashlib
25 | md5_new = hashlib.md5
26 | except ImportError:
27 | import md5
28 | md5_new = md5.new
29 |
30 | def md5sum(filename, CHUNK=CHUNK_SIZE):
31 | """takes filename, hand back Checksum of it"""
32 |
33 | try:
34 | fo = open(filename, 'r', CHUNK)
35 |
36 | sum = md5_new()
37 |
38 | # To sum the whole file do:
39 | #chunk = fo.read
40 | #while chunk:
41 | # chunk = fo.read(CHUNK)
42 | # sum.update(chunk) #update with nothing does not change sum
43 |
44 |
45 | # Note if seek past end of file then read() returns ''
46 | # Consequently the md5 will be the same as if one did:
47 | # md5sum /dev/null
48 | #fo.seek(1024)
49 | chunk=fo.read(CHUNK)
50 | sum.update(chunk)
51 |
52 | fo.close()
53 | del fo
54 |
55 | return sum.hexdigest()
56 | except EnvironmentError as value:
57 | # One gets the following if you do
58 | # fo.seek(-CHUNK, 2) above and file is too small
59 | if value.errno == errno.EINVAL:
60 | return "d41d8cd98f00b204e9800998ecf8427e"
61 | else:
62 | raise
63 |
64 | def printsum(filename):
65 | try:
66 | sys.stdout.write("%s %s\n" % (md5sum(filename),filename))
67 | except EnvironmentError as value:
68 | sys.stderr.write("md5sum: %s: %s\n" % (filename, value.strerror))
69 |
70 | map(printsum, sys.argv[1:])
71 |
--------------------------------------------------------------------------------
/fslint/supprt/rmlint/fix_ws.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e #exit on error
4 |
5 | usage() {
6 | prog=`basename "$0"`
7 | echo "Usage: $prog --eol|'' --indent-spaces|--indent-tabs|'' indent_width|'' filename" >&2
8 | exit 1
9 | }
10 |
11 | [ "$#" = "4" ] || usage
12 |
13 | FILE="$4"
14 | if [ ! -f "$FILE" ]; then
15 | echo "Error: '$FILE' is not a regular file" >&2
16 | exit 1
17 | fi
18 |
19 |
20 | #Use cmp if available
21 | cmp /dev/null /dev/null 2>/dev/null && CMP=cmp || CMP=false
22 |
23 | TMP=${TMPDIR:-/tmp}
24 | TMP="$TMP/fix_ws.$$"
25 |
26 | trap 'rm -f "$TMP"' EXIT
27 |
28 |
29 | if [ "$1" = "--eol" ]; then
30 | #Note \t is a GNU extension
31 | STRIP_EOL_SPACES="sed -e 's/[ ]*$//'"
32 | fi
33 |
34 | if [ "$2" = "--indent-spaces" ]; then
35 | # Sigh. `expand --initial` is buggy in coreutils-5.2.1 at least.
36 | # It ignores tabs after spaces which you can check with:
37 | # printf " \tif\n" | expand --initial -t4 | grep -qF ' ' && echo buggy
38 | # It's fixed in coreutils-6.2 at least and probably much earlier,
39 | # but since the buggy version is in FC4 and ubuntu 5.10
40 | # we had better work around it by running `unexpand` first.
41 | # Hmm still buggy in ubuntu feisty (coreutils-5.97) and
42 | # fedora 8 (coreutils-6.9), probably due to i18n patch?
43 | TAB_CONVERT="unexpand --first-only -t$3"
44 | TAB_CONVERT="$TAB_CONVERT | expand --initial -t$3"
45 | elif [ "$2" = "--indent-tabs" ]; then
46 | TAB_CONVERT="unexpand --first-only -t$3"
47 | fi
48 |
49 | [ "$STRIP_EOL_SPACES" ] && COMMAND="$STRIP_EOL_SPACES"
50 | if [ "$TAB_CONVERT" ]; then
51 | [ "$COMMAND" ] && COMMAND="$COMMAND | "
52 | COMMAND="$COMMAND$TAB_CONVERT"
53 | fi
54 |
55 | [ "$COMMAND" ] || usage
56 |
57 | eval "$COMMAND" < "$FILE" > "$TMP" ||
58 | { echo "Error[$?]: $COMMAND < '$FILE' > '$TMP'" >&2; exit 1; }
59 | ! $CMP -s "$TMP" "$FILE" && cp "$TMP" "$FILE"
60 |
--------------------------------------------------------------------------------
/fslint/supprt/rmlint/fixdup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python2
2 |
3 | # This is called by findup automatically don't call explicitly
4 | # unless you really know what you're doing.
5 | #
6 | # It expects lines in the format:
7 | # filename1
8 | # filename2
9 | #
10 | # filename3
11 | # filename4
12 | # ...
13 |
14 | import sys, string, os, tempfile, errno
15 |
16 | symlink=0
17 | link=1
18 | dryRun=0
19 | if len(sys.argv) == 2:
20 | if sys.argv[1] == "del":
21 | link=0
22 | elif sys.argv[1] == "tdel":
23 | link=0
24 | dryRun=1
25 | elif sys.argv[1] == "tmerge":
26 | dryRun=1
27 | elif sys.argv[1] == "symlink":
28 | symlink=1
29 | elif sys.argv[1] == "tsymlink":
30 | symlink=1
31 | dryRun=1
32 |
33 | ingroup = 0
34 | for line in sys.stdin:
35 | line = line[:-1]
36 | if line == '':
37 | ingroup = 0
38 | else:
39 | if not ingroup:
40 | keepfile = line
41 | ingroup = 1
42 | if dryRun:
43 | sys.stdout.write("\n\nkeeping: " + keepfile + "\n")
44 | if symlink:
45 | sys.stdout.write("symlinking: ")
46 | elif link:
47 | sys.stdout.write("hardlinking: ")
48 | else:
49 | sys.stdout.write("deleting: ")
50 | else:
51 | if dryRun:
52 | sys.stdout.write(line+' ')
53 | else:
54 | dupfile = line
55 | dupdir = os.path.dirname(dupfile)
56 | tmpfile = tempfile.mktemp(dir=dupdir)
57 | try:
58 | if link:
59 | try:
60 | if symlink:
61 | os.symlink(os.path.realpath(keepfile),tmpfile)
62 | else:
63 | os.link(keepfile,tmpfile)
64 | except EnvironmentError as value:
65 | if value.errno == errno.EXDEV and not symlink:
66 | os.symlink(os.path.realpath(keepfile),tmpfile)
67 | else:
68 | raise
69 | os.rename(tmpfile, dupfile)
70 | else:
71 | os.unlink(dupfile)
72 | except OSError:
73 | sys.stderr.write(str(sys.exc_info()[1])+'\n')
74 | try:
75 | #always try this as POSIX has bad requirement that
76 | #rename(file1,file2) where both are links to the same
77 | #file, does nothing, and returns success. So if user
78 | #merges files multiple times, tmp files will be left.
79 | os.unlink(tmpfile)
80 | except:
81 | pass
82 |
--------------------------------------------------------------------------------
/fslint/supprt/rmlint/fixdup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | # Does the same as the python version only slower.
3 | # Systems without python can therefore use this.
4 |
5 | suffix=.fixdup.$$
6 |
7 | symlink=0
8 | link=1
9 | dryRun=0
10 | if [ "$#" = "1" ]; then
11 | if [ "$1" = "del" ]; then
12 | link=0
13 | elif [ "$1" = "tdel" ]; then
14 | link=0
15 | dryRun=1
16 | elif [ "$1" = "tmerge" ]; then
17 | dryRun=1
18 | elif [ "$1" = "symlink" ]; then
19 | symlink=1
20 | elif [ "$1" = "tsymlink" ]; then
21 | dryRun=1
22 | symlink=1
23 | fi
24 | fi
25 |
26 | keepfile='nextfile'
27 | while read file; do
28 | if [ -z "$file" ]; then
29 | keepfile="nextfile"
30 | elif [ "nextfile" = "$keepfile" ]; then
31 | keepfile="$file"
32 | if [ "$dryRun" = "1" ]; then
33 | printf "\n\nkeeping: $keepfile\n"
34 | if [ "$symlink" = "1" ]; then
35 | printf "symlinking: "
36 | elif [ "$link" = "1" ]; then
37 | printf "hardlinking: "
38 | else
39 | printf "deleting: "
40 | fi
41 | fi
42 | else
43 | if [ "$dryRun" = "1" ]; then
44 | printf "$file "
45 | else
46 | if [ "$link" = "1" ]; then
47 | {
48 | test "$symlink" = 0 &&
49 | ln -f -b --suffix="$suffix" -- "$keepfile" "$file" 2>/dev/null;
50 | } ||
51 | ln -sf -b --suffix="$suffix" -- "$keepfile" "$file"
52 | rm -f "$file$suffix"
53 | else
54 | rm -f "$file"
55 | fi
56 | fi
57 | fi
58 | done
59 | if [ "$dryRun" = "1" ] && [ "$keepfile" != "nextfile" ]; then
60 | echo
61 | fi
62 |
--------------------------------------------------------------------------------
/fslint/supprt/rmlint/merge_hardlinks:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python2
2 |
3 | # This is a support script for the findup utility which:
4 |
5 | # Filters unique file sizes.
6 | # Note this can be done also with `uniq -3 -D` in findup.
7 |
8 | # Also filters groups of files with the same size
9 | # that _all_ have the same inode (hardlinks).
10 | # This optimization is the reason for this seperate script.
11 | # Previously we merged hardlinks to only one, but
12 | # this wasn't correct for the case where there were
13 | # multiple independent hardlinks to duplicate files.
14 |
15 | # There is commented out code below which tries
16 | # to filter out as many hardlinks as possible.
17 | # However that is only usuable in a more integrated script
18 | # which can select the particular inode it wants to keep.
19 | # Note this would save disk access as well as CPU
20 | # for files that are too large for cache.
21 |
22 | import os
23 | import sys
24 |
25 | #class counter:
26 | # def __init__(self):
27 | # self.dict = {}
28 | # def add(self,item):
29 | # count = self.dict.get(item,0)
30 | # self.dict[item] = count + 1
31 | # def counts(self,descending=False):
32 | # """Returns list of keys, sorted by values."""
33 | # result = zip(self.dict.values(),self.dict.keys())
34 | # result.sort()
35 | # if descending: result.reverse()
36 | # return result
37 |
38 | last_size=0
39 | last_inode=(0,0)
40 | group_to_check=[]
41 | write_group=0
42 | #group_inodes_count=counter()
43 |
44 | def write_out_group():
45 | sys.stdout.writelines(group_to_check)
46 |
47 | #Keep only one of most numerous inode
48 | #inode_to_keep = group_inodes_count.counts(descending=True)[0][1]
49 | #inode_to_keep_not_written = 1
50 | #for path, dev, inode, size in group_to_check:
51 | # if inode == inode_to_keep:
52 | # if inode_to_keep_not_written:
53 | # inode_to_keep_not_written = 0
54 | # sys.stdout.write("%s %s %s %s\n" % (path, dev, inode, size))
55 | # else:
56 | # sys.stdout.write("%s %s %s %s\n" % (path, dev, inode, size))
57 |
58 | if len(sys.argv) == 2 and sys.argv[1] == '--non-gui':
59 | dups = []
60 | inodes = {}
61 | #inodes required to correctly report disk usage of
62 | #duplicate files with seperate inode groups.
63 | for line in sys.stdin.xreadlines():
64 | path = line[:-1]
65 | if path == '':
66 | if len(inodes)>1:
67 | sys.stdout.writelines(dups)
68 | dups = [line]
69 | inodes = {}
70 | else:
71 | try:
72 | inode = os.stat(path).st_ino
73 | dups.append(line)
74 | inodes[inode] = True
75 | except EnvironmentError:
76 | #file may have been deleted, changed permissions, ...
77 | sys.stderr.write(str(sys.exc_info()[1])+'\n')
78 | else:
79 | if len(inodes)>1:
80 | sys.stdout.writelines(dups)
81 | else: # Initial merging done for both gui and non gui
82 | for line in sys.stdin.xreadlines():
83 | path, dev, inode, size = line.rstrip().split(' ')
84 | if last_size and size == last_size:
85 | if (dev,inode) != last_inode:
86 | write_group=1
87 | group_to_check.append(line)
88 | #group_to_check.append((path,dev,inode,size))
89 | #group_inodes_count.add(inode)
90 | else:
91 | if write_group: write_out_group()
92 | #group_to_check=[(path,dev,inode,size)]
93 | #group_inodes_count.add(inode)
94 | group_to_check=[line]
95 | last_inode = (dev,inode)
96 | last_size = size
97 | write_group = 0
98 | else: #output last group if required
99 | if write_group: write_out_group()
100 |
--------------------------------------------------------------------------------
/fslint/supprt/rmlint/view_ws.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #TODO: only use gvim for text files
4 | #else open items parent
5 |
6 | # View whitespace using [g]vim syntax highlighting
7 | # Pass -g option to use gvim, otherwise vim is used
8 | # Note one can pass - to read stdin
9 |
10 | if [ "$1" = "-g" ]; then
11 | vim="gvim" #maybe -f to not fork?
12 | shift
13 | else
14 | vim="vim"
15 | fi
16 |
17 | if [ "$#" = "1" ]; then
18 | if [ -d "$1" ]; then
19 | xdg-open "$1"
20 | exit
21 | fi
22 | fi
23 |
24 | if ! $vim -h >/dev/null 2>&1; then
25 | cat >/dev/null #to stop xargs warning
26 | echo "Error: please install $vim to view whitespace" >&2
27 | exit
28 | fi
29 |
30 | $vim -R \
31 | +'highlight RedundantSpaces term=standout ctermbg=red guibg=red' \
32 | +'match RedundantSpaces /\s\+$\| \+\ze\t/' \
33 | +'set listchars=tab:>-,trail:.,extends:>' \
34 | +'set list!' "$@"
35 |
--------------------------------------------------------------------------------
/fslint/zipdir:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # zipdir - shrink specified directories.
4 | # Copyright © 2000-2009 by Pádraig Brady .
5 | #
6 | # This program is free software; you can redistribute it and/or modify
7 | # it under the terms of the GNU General Public License as published by
8 | # the Free Software Foundation; either version 2 of the License, or
9 | # any later version.
10 | #
11 | # This program is distributed in the hope that it will be useful,
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14 | # See the GNU General Public License for more details,
15 | # which is available at www.gnu.org
16 |
17 |
18 | # Notes:
19 | #
20 | # Note only directories
21 | # on ext[23] filesystems will be processed at present.
22 | # Note this is required as ext[23] does not deallocate
23 | # directory blocks as they are no longer required.
24 | # As well as taking disk space, it also makes lookups
25 | # in the directory take longer. It would make sense
26 | # to run this as root @ system startup, at the same
27 | # time as fsck? It would be safer to run in single user
28 | # mode since there is a "small" window where data is
29 | # not in a directory when a running process goes to
30 | # look for it. Hmm I guess if there are any extended
31 | # attributes cpio will not copy them?
32 |
33 | script_dir=`dirname "$0"` #directory of this script
34 | script_dir=`readlink -f "$script_dir"` #Make sure absolute path
35 |
36 | . "$script_dir"/supprt/fslver
37 |
38 | Usage() {
39 | ProgName=`basename "$0"`
40 | echo "Shrink Directories.
41 | Usage: $ProgName [[-r] paths(s) ...]
42 |
43 | NB make sure that you don't process directories that are
44 | being referenced by running processes, as this utility
45 | will move directories from their current locations (for
46 | a "small" amount of time). Run only in single user mode
47 | if you are not sure of the consequences.
48 |
49 | If no path(s) specified then the current directory is assumed."
50 | exit
51 | }
52 |
53 | for arg
54 | do
55 | case "$arg" in
56 | -h|--help|-help)
57 | Usage ;;
58 | -v|--version)
59 | Version ;;
60 | *)
61 | argsToPassOn="$argsToPassOn $(shell_quote "$arg")" ;;
62 | esac
63 | done
64 |
65 | if [ `id -u` != "0" ]; then #Only allow root so don't worry about permissions...
66 | echo "Sorry, root permission is required." >&2; exit 1
67 | fi
68 |
69 | cpio --version > /dev/null 2>&1 || \
70 | { echo "Sorry, cpio is required." >&2; exit 1; }
71 |
72 | ESC=`printf "\x1b["`
73 |
74 | #check we have an adequate mv
75 | mvStatus=good
76 | rm -Rf /tmp/fslint2
77 | mkdir /tmp/fslint1 /tmp/fslint2 2> /dev/null
78 | mv -f --target-directory=/tmp/fslint2 /tmp/fslint1 2> /dev/null || mvStatus=bad
79 | rm -Rf /tmp/fslint2
80 |
81 | if [ $mvStatus = "bad" ]
82 | then
83 | echo "Sorry, you need a newer GNU fileutils"
84 | exit
85 | fi
86 |
87 | set -f #no globbing
88 | . "$script_dir"/supprt/getfpf -f "$argsToPassOn" #Force absolute path mode
89 |
90 | #Sanity checks in case user specifies any of these
91 | #can't process /bin as mv & rmdir here
92 | bin=`find -H /bin -maxdepth 0 -printf "%i"`
93 | #can't process /lib as mv & rmdir need libc here
94 | lin=`find -H /lib -maxdepth 0 -printf "%i"`
95 | #can't process /dev as it'll break :-)
96 | din=`find -H /dev -maxdepth 0 -printf "%i"`
97 | #not sure about this, better leave alone
98 | lfin=`find -H /lost+found -maxdepth 0 -printf "%i"`
99 | #inode of all mount points is 1, and obviously can't move mount points
100 | mntin="1"
101 |
102 | export totalSavedBytes=0
103 |
104 | find -H $findArgs -type d -size +2b -depth \( -fstype ext2 -o -fstype ext3 \) \
105 | -xdev \( ! -inum $bin ! -inum $lin ! -inum $din ! -inum $lfin ! -inum $mntin \) \
106 | -printf "$FPF\n" |
107 | tr ' \t' '\1\2' | #TODO: should also use sed to escape shell chars
108 | while read
109 | do
110 | dir=$(echo "$REPLY" | tr '\1\2' ' \t')
111 | find "$dir" -maxdepth 0 -printf "%7s -> "
112 |
113 | origsize=`find "$dir" -maxdepth 0 -printf "%s"`
114 |
115 | basedir=`basename "$dir"`
116 | basepath=`dirname "$dir"`
117 | tmpdir=fslint.shrink
118 | tmpnewdir=$tmpdir/"$basedir"
119 |
120 | cd "$basepath"
121 | mkdir $tmpdir #make here as same device
122 | echo "$basedir" | cpio -pam $tmpdir 2> /dev/null
123 | find "$basedir" -maxdepth 1 -mindepth 1 -print0 |
124 | xargs -r0 mv -f --target-directory="$tmpnewdir"
125 | #mv -f "$basedir"/* "$tmpnewdir"
126 | rmdir "$basedir"
127 | mv "$tmpnewdir" "$basedir"
128 | rmdir $tmpdir
129 | cd -
130 |
131 | new_size=`find "$dir" -maxdepth 0 -printf "%s"`
132 | diffsize=`expr $origsize - $new_size`
133 | if [ $diffsize != "0" ]
134 | then
135 | find "$dir" -maxdepth 0 -printf "${ESC}31m%7s${ESC}0m (bytes) %p\n"
136 | #how to echo the following @ the end?
137 | totalSavedBytes=`expr $diffsize + $totalSavedBytes`
138 | else
139 | find "$dir" -maxdepth 0 -printf "%7s (bytes) %p\n"
140 | fi
141 | done
142 |
--------------------------------------------------------------------------------
/fslint_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pixelb/fslint/10027536342c0bf5a3458e046674d96b2b83aa88/fslint_icon.png
--------------------------------------------------------------------------------
/glade-fixup:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | # Tweak glade files to not give warnings with gtk-2.4
4 |
5 | find -name "*.glade" | xargs sed -i \
6 | '
7 | /name="focus_on_map"/d
8 | /name="ellipsize"/d
9 | /name="width_chars"/d
10 | /name="single_line_mode"/d
11 | /name="urgency_hint"/d
12 | /name="pack_direction"/d
13 | /name="child_pack_direction"/d
14 | /name="angle"/d
15 | '
16 |
--------------------------------------------------------------------------------
/man/fslint-gui.1:
--------------------------------------------------------------------------------
1 | .TH fslint-gui "1" "April 2010" "fslint" "User Commands"
2 | .SH NAME
3 | fslint-gui \- A GUI wrapper for the individual fslint command line tools
4 | .SH SYNOPSIS
5 | .B fslint-gui
6 | [\fIOPTIONS\fR] [\fIPATHS\fR]
7 | .SH DESCRIPTION
8 | .PP
9 | fslint is a toolset to find various problems with filesystems,
10 | including duplicate files and problematic filenames etc.
11 | .PP
12 | Individual command line tools are available in addition to the GUI
13 | and to access them, one can change to, or add to $PATH the
14 | /usr/share/fslint/fslint directory on a standard install.
15 | Each of these commands in that directory have a \-\-help option which
16 | further details its parameters.
17 |
18 | \fBfindup\fR \- find DUPlicate files
19 | .P
20 | \fBfindnl\fR \- find Name Lint (problems with filenames)
21 | .P
22 | \fBfindu8\fR \- find filenames with invalid utf8 encoding
23 | .P
24 | \fBfindbl\fR \- find Bad Links (various problems with symlinks)
25 | .P
26 | \fBfindsn\fR \- find Same Name (problems with clashing names)
27 | .P
28 | \fBfinded\fR \- find Empty Directories
29 | .P
30 | \fBfindid\fR \- find files with dead user IDs
31 | .P
32 | \fBfindns\fR \- find Non Stripped executables
33 | .P
34 | \fBfindrs\fR \- find Redundant Whitespace in files
35 | .P
36 | \fBfindtf\fR \- find Temporary Files
37 | .P
38 | \fBfindul\fR \- find possibly Unused Libraries
39 | .P
40 | \fBzipdir\fR \- Reclaim wasted space in ext2 directory entries
41 | .SH PARAMETERS
42 | If [PATHS] are specified, they become the default search path,
43 | otherwise the current directory becomes the default.
44 | .TP
45 | \fB\-f\fR
46 | always print full paths even if only a single path is specified
47 | .TP
48 | \fB\-r\fR
49 | turn OFF recursion
50 | .TP
51 | \fB\-\-version\fR
52 | Display the fslint version and exit
53 | .TP
54 | \fB\-\-help\fR
55 | Display help for tool specific options
56 | .SH AUTHOR
57 | Written by Padraig Brady
58 | .SH "REPORTING BUGS"
59 | Report bugs to .
60 | .SH COPYRIGHT
61 | Copyright \(co 2000-2009 Padraig Brady .
62 | .br
63 |
64 | This program is free software; you can redistribute it and/or modify
65 | it under the terms of the GNU General Public License as published by
66 | the Free Software Foundation; either version 2 of the License, or
67 | any later version.
68 |
69 | This program is distributed in the hope that it will be useful,
70 | but WITHOUT ANY WARRANTY; without even the implied warranty of
71 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
72 | See the GNU General Public License for more details,
73 | which is available at www.gnu.org
74 |
--------------------------------------------------------------------------------
/man/fslint.1:
--------------------------------------------------------------------------------
1 | fslint-gui.1
--------------------------------------------------------------------------------
/po/Makefile:
--------------------------------------------------------------------------------
1 | DATADIR = /usr/share/
2 | LOCALEDIR = $(DATADIR)/locale
3 | DOMAIN = fslint
4 | INSTALL = $(shell ginstall --help >/dev/null 2>&1 && echo ginstall || echo install)
5 | MSGFMT = $(shell msgfmt --help 2>&1 | grep -- "--check" >/dev/null && echo "msgfmt -c" || echo "msgfmt")
6 |
7 | all: mo
8 |
9 | #create pot file
10 | $(DOMAIN).pot: ../fslint.glade ../fslint-gui
11 | xgettext -d$(DOMAIN) -LGlade ../fslint.glade -o $(DOMAIN).pot
12 | xgettext -k_ -kN_ -d$(DOMAIN) -LPython ../fslint-gui -o $(DOMAIN).pot -j
13 |
14 | #update all po fles
15 | update-po: $(DOMAIN).pot
16 | for po in *.po; do \
17 | lingua=`basename $$po .po`; \
18 | mv $$lingua.po $$lingua.old.po; \
19 | if msgmerge -N -o $$lingua.po $$lingua.old.po $(DOMAIN).pot; then \
20 | rm $$lingua.old.po; \
21 | else \
22 | rm -f $$lingua.po; \
23 | mv $$lingua.old.po $$lingua.po; \
24 | fi \
25 | done
26 |
27 | #create all mo files
28 | mo:
29 | for po in *.po; do \
30 | lingua=`basename $$po .po` ; \
31 | $(MSGFMT) -o $$lingua.mo $$po ; \
32 | mkdir -p locale/$$lingua/LC_MESSAGES/ ; \
33 | ln -f $$lingua.mo locale/$$lingua/LC_MESSAGES/$(DOMAIN).mo ; \
34 | done
35 |
36 | #install mo files
37 | install: mo
38 | for mo in *.mo; do \
39 | lingua=`basename $$mo .mo`; \
40 | $(INSTALL) -D --mode=644 $$lingua.mo $(DESTDIR)/$(LOCALEDIR)/$$lingua/LC_MESSAGES/$(DOMAIN).mo ; \
41 | done
42 |
43 | clean:
44 | rm -Rf locale
45 | rm -f *.mo
46 |
--------------------------------------------------------------------------------
/po/fslint.pot:
--------------------------------------------------------------------------------
1 | # SOME DESCRIPTIVE TITLE.
2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3 | # This file is distributed under the same license as the PACKAGE package.
4 | # FIRST AUTHOR \n"
14 | "Language: tr\n"
15 | "MIME-Version: 1.0\n"
16 | "Content-Type: text/plain; charset=UTF-8\n"
17 | "Content-Transfer-Encoding: 8bit\n"
18 | "X-Launchpad-Export-Date: 2008-05-21 21:12+0000\n"
19 | "X-Generator: Launchpad (build Unknown)\n"
20 |
21 | #: ../fslint.glade:8
22 | msgid "FSlint"
23 | msgstr "FSlint"
24 |
25 | #: ../fslint.glade:81
26 | msgid "Open _Folder"
27 | msgstr ""
28 |
29 | #: ../fslint.glade:111
30 | msgid "_Rename..."
31 | msgstr "Yeniden adlandı_r"
32 |
33 | #: ../fslint.glade:121
34 | msgid "Select all in this directory"
35 | msgstr ""
36 |
37 | #: ../fslint.glade:143
38 | msgid "Select using wildcard"
39 | msgstr "Joker karakterler kullanarak seç"
40 |
41 | #: ../fslint.glade:152
42 | msgid "Unselect using wildcard"
43 | msgstr "Joker karakter kullanarak seçimi kaldır"
44 |
45 | #: ../fslint.glade:161
46 | msgid "within groups"
47 | msgstr "gruplar içinde"
48 |
49 | #: ../fslint.glade:170
50 | msgid "Select all but first"
51 | msgstr "İlki hariç tümünü seç"
52 |
53 | #: ../fslint.glade:179
54 | msgid "Select all but newest"
55 | msgstr "En yenisi hariç tümünü seç"
56 |
57 | #: ../fslint.glade:188
58 | msgid "Select all but oldest"
59 | msgstr "En eskisi hariç hepsini seç"
60 |
61 | #: ../fslint.glade:201
62 | msgid "Toggle selection"
63 | msgstr "Seçimi katla"
64 |
65 | #: ../fslint.glade:210
66 | msgid "Unselect all"
67 | msgstr "Tüm seçimleri kaldır"
68 |
69 | #: ../fslint.glade:327 ../fslint.glade:580
70 | msgid "Add"
71 | msgstr "Ekle"
72 |
73 | #: ../fslint.glade:403 ../fslint.glade:656
74 | msgid "Remove"
75 | msgstr "Kaldır"
76 |
77 | #: ../fslint.glade:450
78 | msgid "Directories to search"
79 | msgstr "Aranacak dizinler"
80 |
81 | #: ../fslint.glade:475
82 | msgid "recurse?"
83 | msgstr ""
84 |
85 | #: ../fslint.glade:499
86 | msgid "Search path"
87 | msgstr "Arama yolu"
88 |
89 | #: ../fslint.glade:711
90 | msgid "Paths to exclude"
91 | msgstr "Dışlanacak yollar"
92 |
93 | #: ../fslint.glade:746
94 | msgid "Extra find parameters"
95 | msgstr "Ek bulma parametreleri"
96 |
97 | #: ../fslint.glade:771
98 | msgid "extra find filtering parameters"
99 | msgstr "ek arama filtreleme parametreleri"
100 |
101 | #: ../fslint.glade:804
102 | msgid "Advanced search parameters"
103 | msgstr "Gelişmiş arama parametreleri"
104 |
105 | #: ../fslint.glade:876
106 | msgid "Minimum file size:"
107 | msgstr ""
108 |
109 | #: ../fslint.glade:901
110 | msgid "Using find -size syntax"
111 | msgstr ""
112 |
113 | #: ../fslint.glade:947 ../fslint.glade:1078 ../fslint.glade:1349
114 | #: ../fslint.glade:1658 ../fslint.glade:1870 ../fslint.glade:2124
115 | #: ../fslint.glade:2245 ../fslint.glade:2417 ../fslint.glade:2550
116 | #: ../fslint.glade:2899
117 | msgid "Name"
118 | msgstr "Ad"
119 |
120 | #: ../fslint.glade:966 ../fslint.glade:1368 ../fslint.glade:1677
121 | #: ../fslint.glade:1889 ../fslint.glade:2143 ../fslint.glade:2264
122 | #: ../fslint.glade:2436 ../fslint.glade:2569 ../fslint.glade:2918
123 | msgid "Directory"
124 | msgstr "Dizin"
125 |
126 | #: ../fslint.glade:985 ../fslint.glade:1927 ../fslint.glade:2340
127 | #: ../fslint.glade:2455 ../fslint.glade:2607 ../fslint.glade:2956
128 | msgid "Date"
129 | msgstr "Tarih"
130 |
131 | #: ../fslint.glade:1020
132 | msgid "Duplicates"
133 | msgstr "Kopya dosyalar"
134 |
135 | #: ../fslint.glade:1097 ../fslint.glade:1696 ../fslint.glade:1908
136 | #: ../fslint.glade:2321 ../fslint.glade:2588 ../fslint.glade:2937
137 | msgid "Size"
138 | msgstr "Boyut"
139 |
140 | #: ../fslint.glade:1211
141 | msgid "Installed packages"
142 | msgstr "Kurulu paketler"
143 |
144 | #: ../fslint.glade:1252
145 | msgid "Sensitivity="
146 | msgstr "Duyarlılık="
147 |
148 | #: ../fslint.glade:1296
149 | msgid "invalid UTF8 mode?"
150 | msgstr "geçersiz UTF8 kipi?"
151 |
152 | #: ../fslint.glade:1403
153 | msgid "Bad names"
154 | msgstr "Bozuk adlar"
155 |
156 | #: ../fslint.glade:1438
157 | msgid "Search ("
158 | msgstr "Ara ("
159 |
160 | #: ../fslint.glade:1483
161 | msgid ") for"
162 | msgstr ""
163 |
164 | #: ../fslint.glade:1530 ../fslint-gui:983
165 | msgid "Conflicting files"
166 | msgstr "Çakışan dosyalar"
167 |
168 | #: ../fslint.glade:1538 ../fslint.glade:1601 ../fslint-gui:981
169 | #: ../fslint-gui:990
170 | msgid "Aliases"
171 | msgstr "Takma adlar"
172 |
173 | #: ../fslint.glade:1577 ../fslint-gui:996
174 | msgid "Case conflicts"
175 | msgstr ""
176 |
177 | #: ../fslint.glade:1585 ../fslint-gui:992
178 | msgid "Same names"
179 | msgstr "Aynı adlar"
180 |
181 | #: ../fslint.glade:1593 ../fslint-gui:994
182 | msgid "Same names(ignore case)"
183 | msgstr ""
184 |
185 | #: ../fslint.glade:1731
186 | msgid "Name clashes"
187 | msgstr "Ad çakışmaları"
188 |
189 | #: ../fslint.glade:1766
190 | msgid "More restrictive search for core files"
191 | msgstr "Core dosyaları için daha kısıtlayıcı arama"
192 |
193 | #: ../fslint.glade:1768
194 | msgid "core file mode?"
195 | msgstr "core dosyası kipi?"
196 |
197 | #: ../fslint.glade:1792
198 | msgid "days"
199 | msgstr "günler"
200 |
201 | #: ../fslint.glade:1812
202 | msgid "minimum age"
203 | msgstr "en az yaş"
204 |
205 | #: ../fslint.glade:1962
206 | msgid "Temp files"
207 | msgstr "Geçici dosyalar"
208 |
209 | #: ../fslint.glade:1998
210 | msgid "Dangling"
211 | msgstr ""
212 |
213 | #: ../fslint.glade:2016
214 | msgid "Absolute links to paths within or below the link's directory"
215 | msgstr ""
216 | "Bağlantının dizininin içindeki ya da altındaki yollara mutlak bağlantılar"
217 |
218 | #: ../fslint.glade:2018
219 | msgid "Suspect"
220 | msgstr "Şüpheli"
221 |
222 | #: ../fslint.glade:2038
223 | msgid "Relative"
224 | msgstr "Göreli"
225 |
226 | #: ../fslint.glade:2058
227 | msgid "Absolute"
228 | msgstr "Mutlak"
229 |
230 | #: ../fslint.glade:2077
231 | msgid "/././. ///// /../ etc."
232 | msgstr "/././. ///// /../ vb."
233 |
234 | #: ../fslint.glade:2079
235 | msgid "Redundant naming"
236 | msgstr "Gerekenden fazla adlandırılmış"
237 |
238 | #: ../fslint.glade:2162
239 | msgid "Target"
240 | msgstr "Hedef"
241 |
242 | #: ../fslint.glade:2197
243 | msgid "Bad symlinks"
244 | msgstr "Bozuk sembolik bağlantılar"
245 |
246 | #: ../fslint.glade:2283
247 | msgid "UID"
248 | msgstr "UID"
249 |
250 | #: ../fslint.glade:2302
251 | msgid "GID"
252 | msgstr "GID"
253 |
254 | #: ../fslint.glade:2375
255 | msgid "Bad IDs"
256 | msgstr "Bozuk ID'ler"
257 |
258 | #: ../fslint.glade:2483
259 | msgid "Empty directories"
260 | msgstr "Boş dizinler"
261 |
262 | #: ../fslint.glade:2513
263 | msgid "Search $PATH"
264 | msgstr "$PATH'i ara"
265 |
266 | #: ../fslint.glade:2642
267 | msgid "Non stripped binaries"
268 | msgstr "Soyulmamış ikililer"
269 |
270 | #: ../fslint.glade:2728
271 | msgid "bad indenting for indent width"
272 | msgstr ""
273 |
274 | #: ../fslint.glade:2836
275 | msgid "whitespace at end of line"
276 | msgstr "satır sonunda boşluk"
277 |
278 | #: ../fslint.glade:2991
279 | msgid "Redundant whitespace"
280 | msgstr "Gerekenden fazla boşluk"
281 |
282 | #: ../fslint.glade:3078
283 | msgid "Find"
284 | msgstr "Bul"
285 |
286 | #: ../fslint.glade:3157
287 | msgid "Stop"
288 | msgstr "Dur"
289 |
290 | #: ../fslint.glade:3236
291 | msgid "Pause"
292 | msgstr ""
293 |
294 | #: ../fslint.glade:3315
295 | msgid "Resume"
296 | msgstr ""
297 |
298 | #: ../fslint.glade:3408
299 | msgid "Select"
300 | msgstr "Seç"
301 |
302 | #: ../fslint.glade:3439
303 | msgid "Save (selected) list to file"
304 | msgstr "(Seçili) listeyi dosyaya kaydet"
305 |
306 | #: ../fslint.glade:3484
307 | msgid "Save"
308 | msgstr "Kaydet"
309 |
310 | #: ../fslint.glade:3515 ../fslint.glade:3667
311 | msgid "selected"
312 | msgstr "seçili"
313 |
314 | #: ../fslint.glade:3560
315 | msgid "Delete"
316 | msgstr "Sil"
317 |
318 | #: ../fslint.glade:3591
319 | msgid ""
320 | "All (except selected) using hardlinks\n"
321 | "(or symlinks if on a different filesystem)"
322 | msgstr ""
323 | "Tümünü (seçililer hariç) hardlinkler kullanarak\n"
324 | "(ya da farklı dosyasistemindeyse sembolink\n"
325 | " bağlantı kullanarak)"
326 |
327 | #: ../fslint.glade:3637
328 | msgid "Merge"
329 | msgstr "Birleştir"
330 |
331 | #: ../fslint.glade:3712
332 | msgid "Clean"
333 | msgstr "Temizle"
334 |
335 | #: ../fslint.glade:3743
336 | msgid "All (except selected) using symbolic links"
337 | msgstr ""
338 |
339 | #: ../fslint.glade:3788
340 | msgid "Symlink"
341 | msgstr ""
342 |
343 | #: ../fslint.glade:3925
344 | msgid "Select Path"
345 | msgstr "Yol Seç"
346 |
347 | #: ../fslint.glade:4106
348 | msgid "ask me this in future?"
349 | msgstr ""
350 |
351 | #: ../fslint-gui:173
352 | #, python-format
353 | msgid "Usage: %s [OPTION] [PATHS]"
354 | msgstr "Kullanım: %s [SEÇENEK] [DİZİNLER]"
355 |
356 | #: ../fslint-gui:174
357 | msgid "display version"
358 | msgstr "versiyonu görüntüle"
359 |
360 | #: ../fslint-gui:175
361 | msgid "display help"
362 | msgstr "yardımı görüntüle"
363 |
364 | #: ../fslint-gui:424
365 | #, python-format
366 | msgid "%(percent)s of %(disk)s is used leaving %(size)sB available"
367 | msgstr ""
368 |
369 | #: ../fslint-gui:560
370 | msgid "Do you want to overwrite?\n"
371 | msgstr "Üzerine yazmak istiyor musunuz?\n"
372 |
373 | #: ../fslint-gui:566
374 | msgid "You can't overwrite "
375 | msgstr "Üzerine yazamazsınız "
376 |
377 | #: ../fslint-gui:602
378 | msgid "Files with the same content"
379 | msgstr "Aynı içerikli dosyalar"
380 |
381 | #: ../fslint-gui:603
382 | msgid "Installed packages ordered by disk usage"
383 | msgstr "Disk kullanımına göre sıralanmış kurulu paketler"
384 |
385 | #: ../fslint-gui:604
386 | msgid "Problematic filenames"
387 | msgstr "Sorunlu dosya adları"
388 |
389 | #: ../fslint-gui:605
390 | msgid "Possibly conflicting commands or filenames"
391 | msgstr "Muhtemelen çakışan komut ya da dosya adları"
392 |
393 | #: ../fslint-gui:606
394 | msgid "Possibly old temporary files"
395 | msgstr "Muhtemelen eski geçici dosyalar"
396 |
397 | #: ../fslint-gui:607
398 | msgid "Problematic symbolic links"
399 | msgstr "Sorunlu sembolink linkler"
400 |
401 | #: ../fslint-gui:608
402 | msgid "Files with missing user IDs"
403 | msgstr "Kayıp kullanıcı kimliğine sahip dosyalar"
404 |
405 | #: ../fslint-gui:609
406 | msgid "Directory branches with no files"
407 | msgstr ""
408 |
409 | #: ../fslint-gui:610
410 | msgid "Executables still containing debugging info"
411 | msgstr "Hala hata ayıklama bilgisi içeren yürütülebilirler"
412 |
413 | #: ../fslint-gui:611
414 | msgid "Erroneous whitespace in a text file"
415 | msgstr "Metin dosyasında hatalı boşluk"
416 |
417 | #: ../fslint-gui:617
418 | msgid "Invalid path ["
419 | msgstr "Hatalı yol ["
420 |
421 | #: ../fslint-gui:658 ../fslint-gui:1359
422 | msgid "searching"
423 | msgstr ""
424 |
425 | #: ../fslint-gui:675
426 | msgid "processing..."
427 | msgstr "işleniyor..."
428 |
429 | #: ../fslint-gui:703
430 | msgid "No search paths specified"
431 | msgstr "Arama yolu belirtilmedi"
432 |
433 | #: ../fslint-gui:860
434 | msgid ""
435 | "Sorry, FSlint does not support this functionality on your system at present."
436 | msgstr "Ne yazık ki, FSlint sisteminizde bu özelliği desteklemiyor."
437 |
438 | #: ../fslint-gui:876
439 | msgid " packages, "
440 | msgstr " paketler "
441 |
442 | #: ../fslint-gui:877
443 | #, python-format
444 | msgid "consuming %sB. "
445 | msgstr "%sB harcıyor "
446 |
447 | #: ../fslint-gui:878
448 | #, python-format
449 | msgid "Note %s."
450 | msgstr "Not %s."
451 |
452 | #: ../fslint-gui:897 ../fslint-gui:937 ../fslint-gui:975 ../fslint-gui:1037
453 | msgid " files"
454 | msgstr " dosyalar"
455 |
456 | #: ../fslint-gui:917
457 | msgid " unstripped binaries"
458 | msgstr " soyulmamış ikililer"
459 |
460 | #: ../fslint-gui:926
461 | msgid " empty directories"
462 | msgstr " boş dizinler"
463 |
464 | #: ../fslint-gui:958
465 | msgid " links"
466 | msgstr " bağlantılar"
467 |
468 | #: ../fslint-gui:974 ../fslint-gui:1090
469 | msgid " wasted in "
470 | msgstr " şurada boşa harcandı: "
471 |
472 | #: ../fslint-gui:1020 ../fslint-gui:1091
473 | msgid " files (in "
474 | msgstr " dosya (şurada: "
475 |
476 | #: ../fslint-gui:1021 ../fslint-gui:1092
477 | msgid " groups)"
478 | msgstr " grup)"
479 |
480 | #: ../fslint-gui:1082
481 | msgid "bytes wasted"
482 | msgstr "byte boşa harcandı"
483 |
484 | #: ../fslint-gui:1169
485 | msgid "None selected"
486 | msgstr "Hiçbiri seçilmedi"
487 |
488 | #: ../fslint-gui:1173
489 | msgid " this item?\n"
490 | msgstr " (bu öğeyi)?\n"
491 |
492 | #: ../fslint-gui:1175
493 | #, python-format
494 | msgid " these %d items?\n"
495 | msgstr " (bu %d öğeyi)?\n"
496 |
497 | #: ../fslint-gui:1325
498 | msgid "User aborted"
499 | msgstr "Kullanıcı vazgeçti"
500 |
501 | #: ../fslint-gui:1352
502 | msgid "paused"
503 | msgstr ""
504 |
505 | #: ../fslint-gui:1499
506 | msgid "Error starting xdg-open"
507 | msgstr ""
508 |
509 | #: ../fslint-gui:1524
510 | msgid "Rename:"
511 | msgstr "Yeniden adlandır:"
512 |
513 | #: ../fslint-gui:1535 ../fslint-gui:1579
514 | #, python-format
515 | msgid "Error: [%s] can not be represented on your file system"
516 | msgstr "Hata: [%s] dosya sisteminizde gösterilemez."
517 |
518 | #: ../fslint-gui:1545
519 | #, python-format
520 | msgid "Error: Can't rename [%(old_path)s] as [%(new_path)s] exists"
521 | msgstr ""
522 | "Hata: [%(old_path)s] yeniden adlandırılamaz çünkü [%(new_path)s] zaten var"
523 |
524 | #: ../fslint-gui:1568
525 | msgid "wildcard:"
526 | msgstr "joker karakter:"
527 |
528 | #: ../fslint-gui:1783
529 | msgid "Sorry, you must be root to delete system packages."
530 | msgstr "Üzgünüm, sistem paketlerini kaldırmak için root olmalısınız."
531 |
532 | #: ../fslint-gui:1788
533 | msgid "Are you sure you want to delete"
534 | msgstr "Silmek istediğinize emin misiniz"
535 |
536 | #: ../fslint-gui:1795
537 | msgid "Are you sure you want to delete all items in this group?"
538 | msgstr ""
539 |
540 | #: ../fslint-gui:1815
541 | msgid "Calculating dependencies..."
542 | msgstr "Bağımlılıklar hesaplanıyor..."
543 |
544 | #: ../fslint-gui:1833
545 | #, python-format
546 | msgid "%d extra packages need to be deleted.\n"
547 | msgstr "%d fazladan paketin silinmesi gerekli.\n"
548 |
549 | #: ../fslint-gui:1834
550 | msgid "Please review the updated selection."
551 | msgstr "Lütfen güncellenmiş seçimi gözden geçirin"
552 |
553 | #: ../fslint-gui:1842
554 | msgid "Removing packages..."
555 | msgstr "Paketler kaldırılıyor"
556 |
557 | #: ../fslint-gui:1887
558 | msgid " items deleted"
559 | msgstr " öğe silindi"
560 |
561 | #: ../fslint-gui:1907
562 | msgid "Are you sure you want to symlink ALL files?\n"
563 | msgstr ""
564 |
565 | #: ../fslint-gui:1909
566 | msgid "Are you sure you want to merge ALL files?\n"
567 | msgstr "TÜM dosyaları birleştirmek istediğinize emin misiniz?\n"
568 |
569 | #: ../fslint-gui:1913
570 | msgid "(Ignoring those selected)\n"
571 | msgstr "(seçili olanlar görmezden geliniyor)\n"
572 |
573 | #: ../fslint-gui:1964
574 | msgid "Which indenting method do you want to convert to?"
575 | msgstr "Hangi girintileme yöntemine dönüştürmek istiyorsunuz?"
576 |
577 | #: ../fslint-gui:1965
578 | msgid "Tabs"
579 | msgstr "Sekmeler"
580 |
581 | #: ../fslint-gui:1965
582 | msgid "Spaces"
583 | msgstr "Boşluklar"
584 |
585 | #: ../fslint-gui:1976
586 | msgid "Are you sure you want to clean"
587 | msgstr "Temizlemek istediğinize emin misiniz?"
588 |
589 | #: ../fslint-gui:2021
590 | msgid " items cleaned ("
591 | msgstr " öğe temizlendi ("
592 |
593 | #: ../fslint-gui:2022
594 | msgid " saved)"
595 | msgstr " boşaltıldı)"
596 |
--------------------------------------------------------------------------------
/po/zh_CN.po:
--------------------------------------------------------------------------------
1 | # Chinese (Simplified) Translation for fslint.
2 | # Copyright (C) 2006 Free Software Foundation, Inc.
3 | # Seann Liu