On Sun, Feb 28, 2010 at 03:13:36PM +0100, Vadkan Jozsef wrote:
e.g.:
$ ls -tr `find -type f` | grep .txt$ | rev
txt.nimdaymphp/.
txt.ccuc/aborp/.
txt.og/.
txt.osle/.
txt.kidosam/.
Why ls?
find -type f | grep .txt$ | rev
(Others already noted that you can probably get what you wanted
e.g.:
$ ls -tr `find -type f` | grep .txt$ | rev
txt.nimdaymphp/.
txt.ccuc/aborp/.
txt.og/.
txt.osle/.
txt.kidosam/.
I Want to truncate this output, until the first /:
$ ls -tr `find -type f` | grep .txt$ | rev | THE-MAGIC-COMES-HERE
.
aborp/.
.
.
.
How?
I just want to modify the names of
Vadkan Jozsef wrote:
e.g.:
$ ls -tr `find -type f` | grep .txt$ | rev
txt.nimdaymphp/.
txt.ccuc/aborp/.
txt.og/.
txt.osle/.
txt.kidosam/.
I Want to truncate this output, until the first /:
$ ls -tr `find -type f` | grep .txt$ | rev | THE-MAGIC-COMES-HERE
You could use cut -d/ -f1.
I
* 2010-02-28 15:13 (+0100), Vadkan Jozsef wrote:
I just want to modify the names of some files, but I can't do it if
they have their full path in their names..
Maybe basename and dirname commands could help?
$ basename /foo/bar/file.txt
file.txt
$ dirname /foo/bar/file.txt
4 matches
Mail list logo