10-16-2019
Script to find file types and info
I'm looking for a way to inventory files on a webserver into a CSV file, and am particularly interested in certain types of files, like .php, .cgi, .pl, .py, .sh, etc. but also want the ability to find all files, including those with no extension, or specified extensions, as above, including files that have spaces or unusual characters or line returns in their names.
I saw the post here:
File Inventory Scan
which had a script that mostly worked and provided good info about the files it found, but couldn't handle files with spaces in their names (last column printed "cannot open: No such file or directory").
Ideally this script would also have columns for file user/group ownership, permissions, access, create and modification times, human readable file size, etc.
I'm on a Solaris 11 machine. I may have the ability to install packages if required.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Trying to use the find command to find any directory which contains a file ending in .zip AND a file ending in .o
I'm having trouble specifying multiple files as criteria and have can't seem to figure it out from Unix in a Nutshell and Google. (2 Replies)
Discussion started by: dangral
2 Replies
2. Shell Programming and Scripting
There are these ksh files and config files that are written and updated on a daily basis.
All I want to do is write a script that finds both these types of files and archive them on a daily basis, to help in restoring in times of system outages and so on. Particulary I'm interested in .ksh ,... (9 Replies)
Discussion started by: manthasirisha
9 Replies
3. Shell Programming and Scripting
Below is part of a script i have written to loop through part of a port info file. How do i continue the script to get info for OS Device Name, manufacturer and then put information into an array?
HBA Port WWN: 10000000c9420b4b
OS Device Name: /dev/cfg/c10
Manufacturer: Emulex... (5 Replies)
Discussion started by: rcon1
5 Replies
4. Linux
Hi,
I'm using the following command to find the multiple requierd file types and its working fine
find . -name "*.pl" -o -name "*.pm" -o -name "*.sql" -o -name "*.so" -o -name "*.sh" -o -name "*.java" -o -name "*.class" -o -name "*.jar" -o -name "*.gz" -o -name "*.Z" -type f
Though... (2 Replies)
Discussion started by: vickramshetty
2 Replies
5. Shell Programming and Scripting
How can I pass $var_find variable as argment to find command?
test.sh
var_find=' \( -name "*.xml" -o -name "*.jsp" \) '
echo "${var_find}"
find . -type f ${var_find} -print
# Below statement works fine.. I want to replace this with the above..
#find . \( -name "*.xml" -o -name... (4 Replies)
Discussion started by: kchinnam
4 Replies
6. UNIX for Dummies Questions & Answers
How do we find the partition type in Linux? df -T will give me the mounted partition types like ufs, ext3 etc. How do I find out for say a newly added disk to the system? Please advise...
Thanks (2 Replies)
Discussion started by: lubu
2 Replies
7. Shell Programming and Scripting
Hi,
I would like to use find to search for multiple types. For example search for symlink and regular file but not directories, sockets etc.... Something like:
find . -type l,f -name "stuff"
But of course it does not work.
Is there any way to avoid an if statement and to do it faster?
... (0 Replies)
Discussion started by: Dedalus
0 Replies
8. Shell Programming and Scripting
I have a record.txt it will update weekly, and it could be 2 lines or more ...
it just echo each line to the script
san jose,23.34%
tampa,2.15%
dallas,30.20%
seattle,44.29%
Unknown,16.72%
How do i write a shell script to give me a test.pl or bash file which contain
#!/home/perl... (8 Replies)
Discussion started by: sabercats
8 Replies
9. Shell Programming and Scripting
Hi All,
I am new here but I have a scripting question that I can't seem to figure out with the "find" cmd.
What I am trying to do is to only have to run a single find cmd parsing the directories and output the different file types to induvidual files and I have been running into problems.... (3 Replies)
Discussion started by: swaters
3 Replies
10. Shell Programming and Scripting
i am looking for a backup script to be run in ssh which can move all *.php files only to a archive
Eg. a folder has 5 sub folders with different file types, which can be mix of PDF, jpeg, gif etc etc.
but the archive generated should only include the *.php files without breaking the directory... (3 Replies)
Discussion started by: netatma
3 Replies
LEARN ABOUT DEBIAN
weborf.conf
Weborf(5) File Formats Manual Weborf(5)
NAME
weborf.conf - configuration file for weborf daemon
SYNOPSIS
/etc/weborf.conf
DESCRIPTION
Weborf is a minimal webserver. Also has a limited support for webdav.
Can be started as stand-alone or as SystemV daemon. This manual page documents Weborf's configuration file, used only when it is started as
daemon.
On debian systems, the script to run weborf as a daemon is located into /usr/share/docs/weborf and has to be manually copied into
/etc/init.d
Weborf is released under the GNU General Public License version 3.
DESCRIPTION
Options are case sensitive. Immediately followed by the equal = sign, without any space between name and value. Lines beginning with #
will be ignored and treated as comments.
indexes
By default weborf searches for index.html. Anyway it is possible to specify a different index file and also many index files. Name
of the pages must be separated by a comma and between them there aren't spaces.
basedir
Default base directory used by the webserver. The default means that this will be used also when virtual hosts are enabled, if the
requested host is unknown. Of course the user used for the webserver will need to have access to this directory.
use-cgi
Can be true or false. If false weborf will handle all files as normal files. Otherwise it will use the CGI protocol to execute some
files.
use-mime
Can be true or false. If true weborf will send the Content-Type header to the clients. Turning it off will increase speed but might
cause problems with some old clients.
cgi List of extensions to consider as dynamic pages and binaries to execute them
auth-bin
Path of the binary that provides authentication to weborf
auth-socket
Path of the unix socket that weborf will use to connect to the authentication server
cachedir
Will set the path of the directory used for caching
user Username of the user that will run the webserver. On debian this is usually www-data.
virtual
This directive is used to enable virtualhosts. One line is needed for each port. The format is: vir-
tual#port#domain1=basedir1,domain2=basedir2
EXAMPLE
Example file can be found in /usr/share/doc/weborf/examples/weborf.conf
SEE ALSO
weborf(1)
VERSION
Weborf0.13
WEB
http://galileo.dmi.unict.it/wiki/weborf/
AUTHORS
Salvo "LtWorf" Tomaselli <tiposchi@tiscali.it>
Salvo Rinaldi <salvin@anche.no>
Minimal webserver Sep 13, 2009 Weborf(5)