Hi,
I have to find specific files only in the current directory...not in the sub directories.
But when I use Find command ... it searches all the files in the current directory as well as in the subdirectories. I am using AIX-UNIX machine.Please help..
I am using the below command. And i am able to list files only in the directory but not in sub-directories.
find . ! -name .
is there any other useful command to go into a specific directory and not go into its subdirectories that operates similar to find.? (it will return the full pathname?) or is there any way to make find not go into the subdirectories of the specified directory? This is on ksh as well.
how do i remove sub directories of a directory and all files which are older than 7 days by a single command in AIX. pls help me.
I am using command as
#find /gpfs1/home/vinod/hpc/ -depth -type d -mtime +7 -exec rm -rf {} \;
so i want to delete all sub directories and all files from the hpc dir. which are older than 7 days.
I've been looking for a code snippet to place in a .sh that removes a directory named after a file.
What I mean by this is I would like to move to specify a directory and then search it for a list of files of type ".XXX" and then remove any subdirectories (with contents) with the same name.
I thought the flags I mentioned in the question are the same, but I get the following message with the former, but nothing with the latter:
$ find .
Chance is that there will be empty files (zero byte files) and empty directories (that doesn’t contain any files) in your system. In this article, I will show you how to locate these empty directories and files and delete them.
The command you can use is the "find" command. To find empty directories in the current directory, you use the option -empty:
find .
How do I manage to find all files in a directory and subdirectories and run a command on them?
For example,
find . -type f -name "*.txt"
finds all txt files and:
find . -type f -name "*.txt" | gedit
sends it to gedit, but inside a text file. I want gedit to open all text files.
Sorry, I know this must have been asked before but I couldn't find it...
Is there a command to remove all files and subdirectories in a directory WITHOUT deleting the directory?
For example if I have directory "dontDeleteMe" with subdirectories "1", "2", "3" and each subdirectory has a few pictures in it, how can I remove the subdirectories "1", "2", and "3" and all the files in the them, withou
I want to cleanup a directory (and subdirectories) from each occurrance of the .py and .pyc files. I tried the following
find . -name '*pyc' -o -name '*py~' -exec rm -f {} \;
which left out all pyc files. When doing
find . -name '*pyc' -o -name '*py~'
the command finds the pyc files, which are not deleted, whatsoever. Any insights?