Sample Header Ad - 728x90

how to get file path without the filename itself

0 votes
2 answers
1065 views
im trying to find my .csv files then cd into their directory: find Documents/notes -type f -name "*.csv" | head -1 | xsel -b this copies the first file dir into my clipboard and i'd like to then run: cd $(xsel -b) but ofcourse I can't because it's including the filename which isn't a directory. Is there anyway to omit the filename? is there a better way to do this?
Asked by Mathew (243 rep)
Sep 17, 2023, 08:26 PM
Last activity: Sep 18, 2023, 12:05 AM