I have output files from
How may I rename these existing files as
If I have 1000 files, the last one should be
n=0 for filename in shivi11*; do n=$(( n + 1 )) mv -i "$filename" "output_$n" done
shivi11* is a pattern that must match all files that you'd like to rename (and nothing else).
Back up your data and test this.
Answer to the original question (before editing it):
If you by "split" mean the
split utility, then you may invoke the utility like this to get what you want (this assumes GNU
split and that you'd like to split the file
file into 20 KB bits):
split -b 20k -a 1 --numeric-suffixes=1 file output_
Note that since we restrict the suffix length to a single character with
-a 1, this would not be able to split into more than 9 files. Using e.g.
-a 2 would create files named
output_02 etc. up to and including
output_99, but not
--numeric-suffixes=1 option is a GNU
split-specific option that selects numeric suffixes starting at the given number (instead of at 0 as using
-d would do). Normally,
split creates files with alphabetic suffixes.