Re: truncate until delimiter

2010-03-04 Thread Tzafrir Cohen
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

truncate until delimiter

2010-02-28 Thread Vadkan Jozsef
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

Re: truncate until delimiter

2010-02-28 Thread Sebastian Luksch
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

Re: truncate until delimiter

2010-02-28 Thread Teemu Likonen
* 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