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 .
Code:
flamingo:~ joliver$ sudo find / -nogroup
find: /dev/fd/4: No such file or directory
find: /home: No such file or directory
find: /Library: No such file or directory
find: /net: No such file or directory
find: /Network: No such file or directory
find: /private: No such file or directory
find: /sbin: No such file or directory
find: /System: No such file or directory
find: /Users: No such
hi
I used find command to find some file names as per input from user. I used it for current directory. It was working fine. Now I tried with giving some other directory path. Its giving issues.
Here what I tried. Script will take input from user say 1_abc.txt, find the file and print list.
I am not going to try to deceive any one this question is for a homework assignment, so if you're unwilling to help that is ok.
The issue is that I am trying to find out if there is a way to use the find utility to show how many different file types there are in a specific directory.
Related: What's the best way to count the number of files in a directory?
I have a system with a very very large number of files in a directory
$ ls -god xml
drwxrwsrwx 7 7070720 Mar 12 11:51 xml
If I try to count specific groups of file using ls xml/*query | wc -l the system usually produces error message
/bin/ls: arg list too long
I tried find xml -name '*query' | wc -l there w
I am able to list all the directories by
find ./ -type d
I attempted to list the contents of each directory and count the number of files in each directory by using the following command
find ./ -type d | xargs ls -l | wc -l
But this summed the total number of lines returned by
find ./ -type d | xargs ls -l
Is there a way I can count the number of files in each directory?
I have a bash script /var/www/scripts/process_sounds.sh that uses the command:
find /var/www/unprocessed_sounds/ * -type f
It's supposed to find all the files in the unprocessed_sounds directory, which it does, but it also find all the files in the scripts directory (and then processes them like sound files, which is not what I want).
Why would find return things in the current directory?
I can't find how to do this.
I want to take a bulk of files, and copy/move a specific number of them (say 1000) to a newly created directory. Once that directory is full, I want to create a new folder and copy/move another batch of files, and so on.
Seems like there should be an easy way to do this, but it eludes me.
I've been using this to search an entire directory recursively for a specific phrase in my code (html, css, php, javascript, etc.):
Code:
find dir_name -type f -exec grep -l "phrase" {} \;
The problem is that it searches ALL files in the directory 'dir_name', even binary ones such as large JPEG images.