Tagged Questions
1
vote
4answers
154 views
Is there a command to list files, exclude sub-directories and display size and date?
Before I begin please assume I have only basic knowledge in UNIX. Basic meaning I have only started reading about it since last week for a work related purpose.
I have been experimenting with the ls ...
1
vote
1answer
78 views
What is a sure fire way to find all files and/or path that contains 2 keywords?
I was doing a
find . -iname '*sitesearch*' | grep demo
because I know the file should be some/path/SiteSearch/demo/SiteSearch.html, but it turned out a person put the file in as ...
2
votes
4answers
100 views
Find directories that do not contain subdirectories
I'm writing script is ksh. Need to find all directory names directly under the current directory which contain only files, not subdirectories.
I know that I could use ls -alR and recursively parse ...
2
votes
2answers
388 views
list all files newer than given timestamp and sort them
I want to list all files (sorted by date) that are newer than timestamp in format 20130207003851 in directory /tmp only. Subdirectories can be omitted.
Using SUSE Linux Enterprise Server 11.
The ...
8
votes
6answers
2k views
How do I list every file in a directory except those with specified extensions?
Suppose that I have a folder containing .txt, .pdf, and other files. I would like to list the "other" files (i.e., files not having the extensions .txt or .pdf). Do you have any advice on how to do ...
3
votes
2answers
604 views
List of Recently Modified Files
How can I Get a list of all files modified , say 3 months ago.
I checked this question but I was not able to apply it to my scenario.
I am trying this now , it seems to be working , but I know there ...
5
votes
4answers
8k views
How can I list subdirectories recursively?
The obvious
ls -dR
does not work.
I am currently using
find /path/ -type d -ls
but the output is not what I need (plain listing of sub-folders)
Is there a way out?
3
votes
1answer
1k views
How can I use `find` and sort the results by mtime?
I want to use find but sort the results reverse chronologically as with ls -ltr. Is this possible through any combo of flags or pipelines?
2
votes
3answers
2k views
How to search and replace text in all php-files in a directory and it's subdirectories
I am looking for a shell script that recursively traverses all .php files in a directory and performs a search & replace of a particular text pattern.
The search pattern is quite long ( > 5000 ...
5
votes
4answers
2k views
How to find a file in the filesystem from the command line?
I'm fairly new to Linux, and I've now found myself in a situation where I'd like to find where a file (with a partially-known filename) is in the file system. I'd like to know how to do this from the ...
5
votes
5answers
5k views
How to report number of files in all subdirectories?
I need to inspect all sub-directories and report how many files (without further recursion) they contain:
directoryName1 numberOfFiles
directoryName2 numberOfFiles
10
votes
5answers
2k views
case-insensitive search of duplicate file-names
I there a way to find all files in a directory with duplicate filenames, regardless of the casing (upper-case and/or lower-case)?
4
votes
4answers
3k views
List symlinks in current directory?
This question talks about finding directories in a current diretory. The solution is basically:
ls -d */
That's great but how can I easily list symlinks? Do I have to use something like
find . ...
5
votes
5answers
3k views
List files larger than {size} sorted by date
I want to solve the problem 'list the top 10 most recent files in the current directory over 20MB'.
With ls I can do:
ls -Shal |head
to get top 10 largest files, and:
ls -halt |head
to get top ...
4
votes
2answers
1k views
How to list ALL directories according to their size? [without including the parent directory]
I have a bunch of random folders, some of them are hidden (beginning with a period). I want to list all of them, sorted by their sizes.
I have something on the lines of this in mind:
ls -d -1 -a */ ...