how to extract specific part of a file name [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite
1













This question already has an answer here:



  • Remove prefixes from filenames

    2 answers



  • how to extract part of a filename before '.' or before extension

    6 answers



I have the following files in a directory:



spp.mydomain.net.current.csv 
spp2.another.really.long.domain.current.csv


I'd like to be able to remove just the spp or the spp2 part of the name using bash.



I found another similar post here but the OP wanted to extract a specific part of the name like this:



awk -F'[.]' 'print $4'


But in my case, I want to keep everything except always remove the first part of the name.







share|improve this question












marked as duplicate by jasonwryan, don_crissti, Jeff Schaller, Archemar, Timothy Martin Mar 14 at 20:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 2




    echo "$line#*."
    – jasonwryan
    Mar 14 at 19:48















up vote
0
down vote

favorite
1













This question already has an answer here:



  • Remove prefixes from filenames

    2 answers



  • how to extract part of a filename before '.' or before extension

    6 answers



I have the following files in a directory:



spp.mydomain.net.current.csv 
spp2.another.really.long.domain.current.csv


I'd like to be able to remove just the spp or the spp2 part of the name using bash.



I found another similar post here but the OP wanted to extract a specific part of the name like this:



awk -F'[.]' 'print $4'


But in my case, I want to keep everything except always remove the first part of the name.







share|improve this question












marked as duplicate by jasonwryan, don_crissti, Jeff Schaller, Archemar, Timothy Martin Mar 14 at 20:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 2




    echo "$line#*."
    – jasonwryan
    Mar 14 at 19:48













up vote
0
down vote

favorite
1









up vote
0
down vote

favorite
1






1






This question already has an answer here:



  • Remove prefixes from filenames

    2 answers



  • how to extract part of a filename before '.' or before extension

    6 answers



I have the following files in a directory:



spp.mydomain.net.current.csv 
spp2.another.really.long.domain.current.csv


I'd like to be able to remove just the spp or the spp2 part of the name using bash.



I found another similar post here but the OP wanted to extract a specific part of the name like this:



awk -F'[.]' 'print $4'


But in my case, I want to keep everything except always remove the first part of the name.







share|improve this question













This question already has an answer here:



  • Remove prefixes from filenames

    2 answers



  • how to extract part of a filename before '.' or before extension

    6 answers



I have the following files in a directory:



spp.mydomain.net.current.csv 
spp2.another.really.long.domain.current.csv


I'd like to be able to remove just the spp or the spp2 part of the name using bash.



I found another similar post here but the OP wanted to extract a specific part of the name like this:



awk -F'[.]' 'print $4'


But in my case, I want to keep everything except always remove the first part of the name.





This question already has an answer here:



  • Remove prefixes from filenames

    2 answers



  • how to extract part of a filename before '.' or before extension

    6 answers









share|improve this question











share|improve this question




share|improve this question










asked Mar 14 at 19:46









dot

2531310




2531310




marked as duplicate by jasonwryan, don_crissti, Jeff Schaller, Archemar, Timothy Martin Mar 14 at 20:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by jasonwryan, don_crissti, Jeff Schaller, Archemar, Timothy Martin Mar 14 at 20:35


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









  • 2




    echo "$line#*."
    – jasonwryan
    Mar 14 at 19:48













  • 2




    echo "$line#*."
    – jasonwryan
    Mar 14 at 19:48








2




2




echo "$line#*."
– jasonwryan
Mar 14 at 19:48





echo "$line#*."
– jasonwryan
Mar 14 at 19:48
















active

oldest

votes






















active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay