Sponsored Content
Top Forums UNIX for Dummies Questions & Answers ?script/cmds 2 list open files???? Post 843 by 98_1LE on Monday 22nd of January 2001 01:55:23 PM
Old 01-22-2001
You could also execute an ls -lu to see when the file was last touched. To do this for an entire directory /var/adm, exectute;
for i in /var/adm
do ls -lu $i
done

Or, to delete any files older than x days, use;
find /var/adm -ctime +x -exec rm -f {} \;
 

10 More Discussions You Might Find Interesting

1. Solaris

What's the difference: 'nuhup cmds' Vs 'cmds &'

Hello, Case: If I want to run a script background and logout, which command should I use ? 1)# ./script_name & 2)# nohup script_name 3)# nohup script_name & And any differences ? What happens if I redirect the output to a file? I learned somewhere that the (1) format will stop... (5 Replies)
Discussion started by: billshu
5 Replies

2. UNIX for Advanced & Expert Users

Using sudo for specific cmds

I've been asked to provide access to my system for another group of individuals to perform WebSphere and Portal tasks (stop/start specifically). I run both as root (we can debate this one later) and so know I have to figure out a way for these individuals to start and stop WebSphere and Portal as... (3 Replies)
Discussion started by: scottsl
3 Replies

3. Shell Programming and Scripting

differnce between these cmds

Hi all, I would like to know the difference between these commands /usr/lib/fs/hsfs/mount -F /dev/lofi/1 /usr and mount -F hsfs /dev/lofi/1 /usr In the first case absolute path is specified and in the next the cmd with options ,whats the differnce. PS:am sorry ,coz this had been... (1 Reply)
Discussion started by: wrapster
1 Replies

4. Shell Programming and Scripting

How to run cmds after changing to a new env (shell) in a shell script

Hi, I am using HP-UNIX. I have a requirement as below I have to change env twice like: cadenv <env> cadenv <env> ccm start -d /dbpath ccm tar -xvf *.tar ccm rcv .... mv *.tar BACKUP but after I do the first cadenv <env> , I am unable to execute any of the later commands . ... (6 Replies)
Discussion started by: charlei
6 Replies

5. Shell Programming and Scripting

I need a script to find socials in files and output a list of those files

I am trying to find socail security numbers in files in (and under) a specific directory and output a list of the files where they are found... the format would be with no dashes just 9 numeric characters in a row. I have tried this: find /DirToLookIn -exec grep '\{9\}' /dev/null {} \; >>... (1 Reply)
Discussion started by: NewSolarisAdmin
1 Replies

6. Shell Programming and Scripting

open 2 files and compare values script - urgent

Hi gurus I have two csv files that are outputs. The file contains data similar to s.no,number1,number2,date1 -------------------------------- 1, a123,482.29,11/28/07 13:00 2,a124,602.7,9/24/07 14:00 3,a125,266.93,10/9/07 16.48 4,a126,785.15,11/14/07 16:08 <file 2> s.no name... (2 Replies)
Discussion started by: inkyponky
2 Replies

7. Shell Programming and Scripting

Help with script to open and compare csv files

We are testing an application that accesses two tables: A and B. I am to write a script to validate the ouput files of this application.The application marks any account that has become overdue as per rule. When it runs, it updates the overdue flag in the A table according to the following rules: ... (1 Reply)
Discussion started by: inkyponky
1 Replies

8. Shell Programming and Scripting

Using programs to open files from within the script?

I am suppose to make a program that cuts the extension off of a file. It uses that .ext to decide which program needs to be used to open the file. This only finds the name of the program from a list of programs I made. My problem is when it has the name of the program it needs to use, how can I... (2 Replies)
Discussion started by: dordrix
2 Replies

9. Shell Programming and Scripting

Script to open files and write into new one

Hello! I am a real beginner in scripting, so I am struggling with a really easy task! I want to write a script to concatenate several text files onto each other and generate a new file. I wanted the first argument to be the name of the new file, so: ./my_script.sh new_file file1.txt... (5 Replies)
Discussion started by: malajedala
5 Replies

10. Shell Programming and Scripting

Script to find Error: rpmdb open failed on list of servers

Hello all, I have a task to patch red hat servers and some servers have a corrupted rpm database and return the error: Error: rpmdb open failed I know how to fix this when it occurs. What I'm hoping to do is scan a list of servers by IP and report back which server have this error. ... (6 Replies)
Discussion started by: greavette
6 Replies
unlink(2)							System Calls Manual							 unlink(2)

NAME
unlink - remove directory entry; delete file SYNOPSIS
DESCRIPTION
The system call removes the directory entry named by the path name pointed to by path. When all links to a file have been removed and no process has the file open, the space occupied by the file is freed and the file ceases to exist. If one or more processes have the file open when the last link is removed, only the directory entry is removed immediately so that processes that do not already have the file open cannot access the file. After all processes close their references to the file, if there are no more links to the file, the space occupied by the file is then freed and the file ceases to exist. RETURN VALUE
returns the following values: Successful completion. Failure. is set to indicate the error. ERRORS
If fails, is set to one of the following values: Search permission is denied for a component of the path prefix. Write permission is denied on the directory containing the link to be removed. The process does not have read/write access permission to the parent directory. The entry to be unlinked is the mount point for a mounted file system. path points outside the process's allocated address space. The reliable detection of this error is implementation dependent. Too many symbolic links were encountered in translating the path name. The length of the specified path name exceeds bytes, or the length of a component of the path name exceeds bytes while is in effect. The named file does not exist (for example, path is null or a component of path does not exist). A component of the path prefix is not a directory. The directory containing the file to be removed has the sticky bit set and neither the containing directory nor the file to be removed are owned by the effective user ID. The named file is a directory and the effective user ID is not a user with appropriate privileges. Some file systems return this error whenever the named file is a directory, regardless of the user ID. The directory entry to be unlinked is part of a read-only file system. The entry to be unlinked is the last link to a pure procedure (shared text) file that is being executed. WARNINGS
If is used on a directory that is not empty (contains files other than and the directory is unlinked, the files become orphans, and the directory link count is left with an inaccurate value unless they are linked by some other directory. If is used on a directory that is empty (contains only the files and the directory is unlinked, but the parent directory's link count is left with an inaccurate value. In either of the above cases, the file system should be checked using (see fsck(1M)). To avoid these types of problems, use instead (see rmdir(2)). SEE ALSO
rm(1), close(2), link(2), open(2), rmdir(2), remove(3C), privileges(5). STANDARDS CONFORMANCE
unlink(2)
All times are GMT -4. The time now is 07:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy