Hi,.
I am writing a script to get the new files and split them.
Requirement
Find the new files under the path "/wload/scmp/app/data/OAS" (There are 5 sub folders).
Need to
1. archive all the files in a directory from the previous month into a tar/gz file, ignoring all already archived 'tar.gz' files
2. Check created .tar.gz file isnt corrupted and has all the required files in it. and then remove the original files.
I am using a function to get the last month name from the current sys date.
Contents of my dir are
$ ls -lrt
total 0
-rw-r--r-- 1 user1 admin 19 Oct 8 12:31 night.txt
-rw-r--r-- 1 user1 admin 19 Oct 8 12:31 noon.txt
-rw-r--r-- 1 user1 admin 38 Oct 8 12:31 day.txt
I would like to list out details of files that have a word in the filename as specified.
Example :
$ ls -lrt *day|night*
ls: *day: No such file or directory
bash: night.txt: command not found
Expected
If I have a directory full of files and sub directories. What is the best way to list just the regular files which fall alphabetically before a given string?
Currently the best I can do using bash is the following:
for x in `find .
I have over one million files. And I have to proceed over them.
My files' directory hierarchies just like below
source=/opt/output/renamed/
target=/opt/output/combine
send=/opt/output/send/combined
Firstly I have to loop 1000 files from source (/opt/output/renamed) directory and group them by filename.
Hi,
I would like to list all files, older than 7 days, in a directory, but exclude all subdirectories in the find command. If I use find . -type f -mtime +7 all files in the subdirs are also included. How can I exclude them?
Regards,
JW
what I am trying to do is to compress a list of files using tar.
So what I am doing is
sudo tar -pcf filename.tgz `cat filename.list`
so if there is a directory on the list like this
/home/vmuser/.gconf
tar compresses everything in that folder. However what I want is to just add exactly whatever is on the list.
Is is it possible to use the locate command to only find directories? To rephrase, I want to search for a directory, and exclude any result that is not a directory, such as files or symlinks to files.
While not necessary, I would like the solution to also return symlinks to other directories (but again, not files).
Lastly, I would like to exclude directories within foo, with one exception.
I have: a directory with many nested subdirectories and files.
I would like: a list of all files whose name doesn't contain a certain string.
Example file structure:
foo/
foo/bar/foobar.txt
foo/foo/foobartest.txt
foo/foobartest.txt
If I enter my query with the string "test" it should return only /foo/bar/foobar.txt
I suppose one would use find with some regex?
Thanks a lot for your help!