Hi,
I need to get the latest file from a list of files in a particular directory.
Please could anyone help me out to get the file.
Thank you,
- Jay. (1 Reply)
i have a directory in which there are executable files and these files are added at runtime. now i need a shell script which will be called at a certain interval. this shell script should find the latest executable file in that directory and start that executable. care should be taken that once the... (6 Replies)
Hi everyone,
Please help:)
I have a list of 1000 different files which comes daily to the directory.Some of
the files are not coming to the directory now.
I need to write a shell script to find the latest date and time of the files they
came to the directory. The files should be unique.... (1 Reply)
Hello
I have three directory structures for code releases.
Each directory structure looks like this:
bash-3.00$ ls -R | more
.:
Test_Release_1
Test_Release_2
Test_Release_3
./Test_Release_1/dbcode:
rp_online_import_srdp.pkb-1
srdp_ar_validation.pkb-1... (1 Reply)
Hello friends,
Plz suggest the find command,
How to search a string in a paticular string in miltiple files with current dirctory.:)
Thanks in advance.
Siva Ranganath Ch (2 Replies)
Hi,
I am new to unix and shell scripting,can anybody help me in sctipting a requirement.
my requirement is to get the latest directory the name of the directory will be like CSB.monthdate_time stamp
like CSB.Sep29_11:16 and CSB.Oct01_16:21.
i need to pick the latest directory.
in the... (15 Replies)
Hi guys,
I need to find multiple strings within files under a directory and secondly, to count how many files are there with these strings.
At present, i am able to do this in order to find one string (for example "abc"):
find <path> -exec grep "abc" {} /dev/null \;
Now for example, i... (2 Replies)
hi,
i have some file in a directory say
p1.txt.201305051200.lst
p1.txt.201305051300.lst
p1.txt.201306051200.lst
p1.txt.201306051300.lst
p2.txt.201306051200.lst
p2.txt.201306051300.lst
i am using p* pattern to retrieve these file
ls -1 p*
the files in red color are the latest... (7 Replies)
I am trying to fetch the latest modified file from a directory using the command
find . -type f -exec ls -lt \{\} \+ | head | awk '{print $9}'
After the O/P, I get the below mentioned error and the command doesnt terminate at all.
find: ls terminated by signal 13
find: ls terminated by... (2 Replies)
I have tried the following code and with that i couldnt achieve what i want.
#!/usr/bin/bash
find ./ -type f \( -iname "*.xml" \) | sort -n > fileList
sed -i '/\.\/fileList/d' fileList
NAMEOFTHISFILE=$(echo $0|sed -e 's/\/()$*.^|/\\&/g')
sed -i "/$NAMEOFTHISFILE/d"... (2 Replies)
Discussion started by: gold2k8
2 Replies
LEARN ABOUT DEBIAN
dpkg-name
dpkg-name(1) dpkg utilities dpkg-name(1)NAME
dpkg-name - rename Debian packages to full package names
SYNOPSIS
dpkg-name [option...] [--] file...
DESCRIPTION
This manual page documents the dpkg-name program which provides an easy way to rename Debian packages into their full package names. A full
package name consists of package_version_architecture.package-type as specified in the control file of the package. The version part of the
filename consists of the upstream version information optionally followed by a hyphen and the revision information. The package-type part
comes from that field if present or fallbacks to deb.
OPTIONS -a, --no-architecture
The destination filename will not have the architecture information.
-k, --symlink
Create a symlink, instead of moving.
-o, --overwrite
Existing files will be overwritten if they have the same name as the destination filename.
-s, --subdir [dir]
Files will be moved into a subdirectory. If the directory given as argument exists the files will be moved into that directory oth-
erwise the name of the target directory is extracted from the section field in the control part of the package. The target directory
will be `unstable/binary-architecture/section'. If the section is not found in the control, then `no-section' is assumed, and in
this case, as well as for sections `non-free' and `contrib' the target directory is `section/binary-architecture'. The section field
isn't required so a lot of packages will find their way to the `no-section' area. Use this option with care, it's messy.
-c, --create-dir
This option can used together with the -s option. If a target directory isn't found it will be created automatically. Use this
option with care.
-?, --help
Show the usage message and exit.
-v, --version
Show the version and exit.
EXAMPLES
dpkg-name bar-foo.deb
The file `bar-foo.deb' will be renamed to bar-foo_1.0-2_i386.deb or something similar (depending on whatever information is in the
control part of `bar-foo.deb').
find /root/debian/ -name '*.deb' | xargs -n 1 dpkg-name -a
All files with the extension `deb' in the directory /root/debian and its subdirectory's will be renamed by dpkg-name if required
into names with no architecture information.
find -name '*.deb' | xargs -n 1 dpkg-name -a -o -s -c
Don't do this. Your archive will be messed up completely because a lot of packages don't come with section information. Don't do
this.
dpkg-deb --build debian-tmp && dpkg-name -o -s .. debian-tmp.deb
This can be used when building new packages.
BUGS
Some packages don't follow the name structure package_version_architecture.deb. Packages renamed by dpkg-name will follow this structure.
Generally this will have no impact on how packages are installed by dselect(1)/dpkg(1), but other installation tools might depend on this
naming structure.
SEE ALSO deb(5), deb-control(5), dpkg(1), dpkg-deb(1), find(1), xargs(1).
Debian Project 2012-04-15 dpkg-name(1)