Skip to content

Commit

Permalink
add function to remove prefix from all files in a directory
Browse files Browse the repository at this point in the history
  • Loading branch information
the-gigi committed Mar 30, 2020
1 parent 9ba15c7 commit 8ccdafc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion components/general.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,11 @@ function sq
# Better CLI
#alias cat='bat'
#alias grep='rg'
#alias man='tldr'
#alias man='tldr'

# Remove the prefix from all files in the current directory
function remove_prefix_in_current_dir()
{
profix=$1
for f in "$prefix"*;do mv "$f" "${f#"$prefix"}";done
}

0 comments on commit 8ccdafc

Please sign in to comment.