Hi all,
I have a shell script(ksh) which has the code as follows.
------------------
cd $mydir
for i in `find ./ -type f -mtime +$k`
do
echo $i
done
-----------------------
And in $mydir , i have some files which have space in theie names like "Case att15".
The out put of the... (6 Replies)
Hi,
Having a simple issue with find command on Sun. The command works fine if the variable is set to the actual filesystem but fails when the variable is set to a link which is pointing to the same filesystem.
export DUMPDEST=/oradata1/exports/pbm - Set the variable
... (2 Replies)
Hi all, i'm new at shell scripting world...
I'm working on a script for searching old files on a server, this scripts runs with a configuration file wich indicates where to search the files, the script should search for all files that are older than an x qty of days, and the only clue that i have... (9 Replies)
Hi,
I am issuing find command below mentioned ways but it givs different count. I don't understand the behaviour. Could any one have any clue?
$ find . -mtime -5 -maxdepth 1 -exec ls -lrt {} \; | wc -l
169
$ find . -mtime -5 -maxdepth 1 | wc -l
47
$ find . -mtime -5 -maxdepth 1 | wc -l... (2 Replies)
I am currently using below command to get the 1st three characters of a file(PDM). Issue is, when i use find command in root dir, it finds all the files in sub dir also.
How to limit the find command search to a given path only(ie: say only find file in apps/cmplus/datamigration/data path... (3 Replies)
Hi All,
I'm a bit new to Linux environment, moderately okay when it comes to Unix AIX. I'm facing an issue while trying to run a simple find command:
$ for file in `find . -name *.*`
> do
> ls $file
> done
This is throwing the following error:
Strangely, a few minutes... (4 Replies)
Hi,
I am not root user. I am trying to find the file which has contains pattern "fvsfile" in root directory.
If i run the find cmd then i got permission denied and all the files are listed include pattern files. i cant get file name yet
find . print | xargs grep -i "fvsfile"
I want... (2 Replies)
Hi,
I have created a shell script for Server Log Automation Process. I have used
find xargs grep command to search the string.
for Example,
find -name | xargs grep "816995225" > test.txt .
Here my problem is,
We have lot of records and we want to grep the string... (4 Replies)
Hi
I am using the below code to find mv the files.
Files are moving to the Target location as expected but find is displaying some errors like below.
find ./ -name "Archive*" -mtime +300 -exec mv {} /mnt/X/ARC/ \;
find: `./Archive_09-30-12': No such file or directory
find:... (6 Replies)
Hi Guys,
I have a file called error.logs. am just trying to display the content in the file which was modified last 1 day. I tried below command but it doesnt give the proper output.
find /u/text/vinoth/bin "error.logs" -mtime -1 -exec cat {} \; >> mail.txt
Any help is much... (21 Replies)
Discussion started by: Vinoth Kumar G
21 Replies
LEARN ABOUT OPENSOLARIS
file
file(1B) SunOS/BSD Compatibility Package Commands file(1B)NAME
file - determine the type of a file by examining its contents
SYNOPSIS
/usr/ucb/file [-f ffile] [-cL] [-m mfile] filename...
DESCRIPTION
file performs a series of tests on each filename in an attempt to determine what it contains. If the contents of a file appear to be
ASCII text, file examines the first 512 bytes and tries to guess its language.
file uses the file /etc/magic to identify files that have some sort of magic number, that is, any file containing a numeric or string con-
stant that indicates its type.
OPTIONS -c Check for format errors in the magic number file. For reasons of efficiency, this validation is not normally carried out. No
file type-checking is done under -c.
-f ffile Get a list of filenames to identify from ffile.
-L If a file is a symbolic link, test the file the link references rather than the link itself.
-m mfile Use mfile as the name of an alternate magic number file.
EXAMPLES
Example 1 Using file on all the files in a specific user's directory.
This example illustrates the use of file on all the files in a specific user's directory:
example% pwd
/usr/blort/misc
example% /usr/ucb/file *
code: mc68020 demand paged executable
code.c: c program text
counts: ascii text
doc: roff,nroff, or eqn input text
empty.file: empty
libz: archive random library
memos: directory
project: symboliclink to /usr/project
script: executable shell script
titles: ascii text
s5.stuff: cpio archive
example%
ENVIRONMENT VARIABLES
The environment variables LC_CTYPE, LANG, and LC_default control the character classification throughout file. On entry to file, these
environment variables are checked in the following order: LC_CTYPE, LANG, and LC_default. When a valid value is found, remaining environ-
ment variables for character classification are ignored. For example, a new setting for LANG does not override the current valid character
classification rules of LC_CTYPE. When none of the values is valid, the shell character classification defaults to the POSIX.1 "C"
locale.
FILES
/etc/magic
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscpu |
+-----------------------------+-----------------------------+
SEE ALSO magic(4), attributes(5)BUGS
file often makes mistakes. In particular, it often suggests that command files are C programs.
file does not recognize Pascal or LISP.
SunOS 5.11 14 Sep 1992 file(1B)