[ILUGC] Re: GNU/Linux commands - basename

  • From: Balasubramaniam Natarajan <bala150985@xxxxxxxxx>
  • To: ilugc@xxxxxxxxxxxxx
  • Date: Tue, 20 Sep 2016 11:10:24 +0530

Good one, Dhanasekar to remove suffix we need to give what needs to be
removed like so.
$ touch bala.txt
$ echo "Hello" > bala.txt
$ basename /tmp/bala.txt
bala.txt
$ basename /tmp/bala.txt txt
bala.
$ basename /tmp/bala.txt .txt
bala


On Mon, Sep 19, 2016 at 7:23 PM, Dhanasekar <tkdhanasekar@xxxxxxxxx> wrote:

Hi,
basename - strip directory and suffix from filenames

$ basename /etc/apache2/

$ basename /etc/apache2/apache2.conf

$ basename perlscript script

$ basename /etc/group

$ basename /etc/passwd


regards,

T.Dhanasekar


_____________________________________
ILUGC List: //www.freelists.org/list/ilugc
ILUGC Web: http://ilugc.in/




-- 
Regards,
Balasubramaniam Natarajan
http://bullet-bala.blogspot.in/ ;<http://blog.etutorshop.com>
https://www.youracclaim.com/user/balasubramaniam-natarajan


_____________________________________
ILUGC List: //www.freelists.org/list/ilugc
ILUGC Web: http://ilugc.in/

Other related posts: