-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
rnm.1
1488 lines (1488 loc) · 32.9 KB
/
rnm.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.\"t
.\" Automatically generated by Pandoc 1.16.0.2
.\"
.TH "rnm" "1" "March 13, 2017" "rnm user manual" ""
.hy
.SH NAME
.PP
rnm \- Bulk rename utility
.SH SYNOPSIS
.PP
\f[B]rnm\f[] [\f[I]options\f[]] \f[I]file/paths\f[]
.SH DESCRIPTION
.PP
Renames files/directories in bulk.
Naming scheme (\f[I]Name String\f[]) can be applied or regex replace can
be performed to modify names dynamically.
It uses PCRE2 (revised version of PCRE) regex to provide search (and
replace) functionality.
.PP
It provides versatile options to modify names, delete/replace part of
it, indexing, case conversion, insert text, insert various file
information like modification time, access time, permission etc..,
insert parent directory names and many more.
.PP
File search functionality is provided with PCRE2 regex.
Fixed string search is also possible.
.PP
Operations (rename, changing names, search) are selective of file type
(directory, file, link).
.PP
Files can be sorted by name, modification time, access time, size, file
type (directory, file, link) etc..
.PP
It provides an undo functionality to move back unwanted rename
operations.
Different \f[B]rnm\f[] operations on different directory remember their
own undo history.
.PP
Simulations can be run instead of actual rename to view the potential
outcome as program output on terminal with the \f[I]\-sim\f[] option.
.SH USAGE
.IP
.nf
\f[C]
rnm\ \-ns\ name_string\ [other\-opts]\ file/path
rnm\ \-rs\ "/search/replace/mod"\ [other\-opts]\ file/path
rnm\ \-ns/f\ namestring/file/path\ file/path
\f[]
.fi
.SH OPTIONS
.TP
.B \-ns \f[I]name\-string\f[]
Name string.
This is generally the new name for the file.
Any part in this name string wrapped around with the path delimiter (/)
is parsed as a name string rule and the new name is formed accordingly.
See NAME STRING RULE for details.
.RS
.RE
.TP
.B \-ns/f \f[I]file\-path\f[]
Name string file.
File containing name strings per line.
It makes a new name string rule available, namely \f[I]/nsf/\f[], which
is generated by parsing the name string taken from the corresponding
line in the file.
Another additional rule \f[I]/l/\f[] becomes available for line number.
If \f[I]\-ns\f[] or \f[I]\-rs\f[] is not given, \f[I]/nsf/\f[] becomes
the new name.
This option adds a restriction on the number of files to be renamed
which is same as the number of non\-empty lines in the name string file
.
.RS
.RE
.TP
.B \-ns/fn \f[I]file\-path\f[]
Name String file.
This takes a null terminated Name String file, i.e a file where
filenames/name strings are terminated by null character (\f[I]\\0\f[])
instead of new line (\f[I]\\n\f[]).
.RS
.RE
.TP
.B \-sl \f[I]start\-line\f[]
Start Line number in name string file.
If start line is 0, it is changed to the highest line number possible in
the file.
For example, if you want to go from last line to first line, you can
pass start line as 0 and end line as 1.
Empty lines are always ignored but line numbers are counted.
Start line can be greater than end line, for example, start line 25 and
end line 12 would mean: go from line 25 to 12.
Default start line is 1.
.RS
.RE
.TP
.B \-l \f[I]start\-line\f[]
Same as \f[I]\-sl\f[]
.RS
.RE
.TP
.B \-el \f[I]end\-line\f[]
End line number in name string file to stop renaming from.
If end line is 0, it is changed to the highest line number possible in
the file.
For example, if you want to go from first line to last line in the file,
pass start line as 1 and end line as 0.
Empty lines are always ignored but line numbers are counted.
End line can be smaller than start line.
Default end line is the highest line number in the file.
.RS
.RE
.TP
.B \-linc \f[I]line\-increment\f[]
The amount line count will be incremented in each iteration for name
string file.
.RS
.RE
.TP
.B \-ss \f[I]search\-regex\f[]
Search string.
String that will be used to search for files with matching names.
This is generally a regex if not passed with \f[I]\-ssf\f[] option.
See SEARCH STRING for details.
This option can be given multiple times to add search strings.
.RS
.RE
.TP
.B \-ss/f \f[I]file\-path\f[]
Search string file.
A file containing search string per line.
This option can be given multiple times to add search strings.
.RS
.RE
.TP
.B \-ssf \f[I]fixed\-search\-term\f[]
Fixed search string (not treated as regex).
See SEARCH STRING for details.
This option can be given multiple times to add search strings.
.RS
.RE
.TP
.B \-ssf/f \f[I]file\-path\f[]
Search string file.
Contains fixed search string per line.
This option can be given multiple times to add search strings.
.RS
.RE
.TP
.B \-rs \f[I]replace\-string\f[]
A string in the form:
.RS
.IP
.nf
\f[C]
/regex/replace/modifier
\f[]
.fi
.PP
It performs regex replace on old filename to construct new name.
It uses PCRE2 regex.
After performing all the regex replace operations, the resultant string
is stored in the name string rule \f[I]/rn/\f[].
It can be used inside a name string or if name string is not given, this
will by default become the new name for the current file.
See REPLACE STRING for details.
This option can be given multiple times to add replace strings.
.RE
.TP
.B \-rs/f \f[I]file\-path\f[]
Replace string file.
A file containing replace string per line.
This option can be given multiple times to add replace strings.
.RS
.RE
.TP
.B \-si \f[I]start\-index\f[]
Start index.
.RS
.RE
.TP
.B \-i \f[I]start\-index\f[],
Same as \f[I]\-si\f[]
.RS
.RE
.TP
.B \-ei \f[I]end\-index\f[]
End index.
It works on directory index only.
When rename is occurring inside a directory for a depth value greater
than 0 or negative, directory index is limited to this end index.
When incrementing directory index hits this limit, all remaining
files/directories/links inside that directory are skipped.
All directories and their subdirectories will be subject to this
limiting value.
.RS
.RE
.TP
.B \-inc \f[I]increment\f[]
Increment value (floating point decimal).
The amount, index will be incremented or decremented in each iteration.
Decremented index is available through name string rule \f[I]/\-i/\f[],
\f[I]/\-id/\f[] etc..
.RS
.RE
.TP
.B \-if \f[I]INDEX\-FLAGS\f[]
This sets Index flags.
This is a \[aq]/\[aq] separated list of flags that will be used to
render the index within it\[aq]s text field.
The general format is:
.RS
.IP
.nf
\f[C]
\[aq]/flag1/flag2/flag3=value/...\[aq]
\f[]
.fi
.PP
Valued flags are set with \f[I]flag=value\f[] format.
Ex:
.IP
.nf
\f[C]
\[aq]/uppercase/filler=*/\[aq]
\f[]
.fi
See INDEX FLAGS for details.
.RE
.TP
.B \-ifl \f[I]index\-field\-length\f[]
Index field length.
Non occupied field will be filled with index field fillers (set with
\f[I]\-iff\f[]).
\f[I]iff\f[] is set to the character \f[I]0\f[] by default.
.RS
.RE
.TP
.B \-iff \f[I]index\-field\-filler\f[]
Non\-occupied field in index will be filled with a character set by this
option.
.RS
.RE
.TP
.B \-ifp \f[I]index\-field\-precision\f[]
Index is a floating point decimal (by default) value.
This sets the precision.
.RS
.RE
.TP
.B \-dp \f[I]depth\f[]
Depth of folder.
\-1(any negative number) means unlimited depth i.e all files and
subdirectories will be included.
Other values may be 0 1 2 3 etc...
Default depth is \f[I]0\f[], i.e directory contents will be ignored.
.RS
.RE
.TP
.B \-duh \f[I]seconds\f[]
Delete undo history older than the given seconds.
.RS
.RE
.TP
.B \-duhd \f[I]days\f[]
Delete undo history older than the given days.
.RS
.RE
.TP
.B \-fo
File only mode.
Only files are renamed (no directory or link).
Goes to subdirectory/s if depth (\f[I]\-dp\f[]) is greater than 0 or
negative.
.RS
.RE
.TP
.B \-do
Apply rename on directory only.
Goes to subdirectories if depth is greater than 0 or negative.
.RS
.RE
.TP
.B \-lo
Link only mode.
Goes to subdirectories if depth is greater than 0 or negative.
.RS
.RE
.TP
.B \-xd
Exclude directory.
Exclude any and all directories and their contents.
The depth value \f[I]\-dp\f[] will have no effect if this option is
given.
This is by default equivalent to file+link only mode if not overridden
by other options.
(You can read this option as cross\-d which probably makes more sense)
.RS
.RE
.TP
.B \-xf
Exclude file.
Depth value \f[I]\-dp\f[] is respected and goes to subdirectories if
depth is greater than 0 or negative.
This is by default equivalent to directory+link only mode if not
overridden by other options.
(You can read this option as cross\-f which probably makes more sense)
.RS
.RE
.TP
.B \-xl
Exclude link.
Depth value \f[I]\-dp\f[] is respected and goes to subdirectories if
depth is greater than 0 or negative.
This is by default equivalent to directory+file only mode if not
overridden by other options.
(You can read this option as cross\-l which probably makes more sense)
.RS
.RE
.TP
.B \-fl
Set follow link flag.
After passing this option, any file that is a link will be followed to
their original target.
If there are multiple links associated, only the end target (the
original) will be renamed.
This option must be passed before the file path that needs to be
followed.
Passing it after the file path will have no effect on the previous
files.
.RS
.RE
.TP
.B \-nfl
Unset follow link flag.
After this option is passed, previously set \f[I]\-\-follow\-link\f[]
flag will be unset and symbolic links after this point will not be
followed unless it gets overridden by another \f[I]\-fl\f[] option.
.RS
.RE
.TP
.B \-cd
Count directory in reserved index, regardless of other options.
Reserves indexes for directories even if it is file only or link only
mode.
.RS
.RE
.TP
.B \-cf
Count file in reserved index, regardless of other options.
Reserves indexes for files even if it is directory only or link only
mode.
.RS
.RE
.TP
.B \-cl
Count link in reserved index, regardless of other options.
Reserves indexes for links even if it is directory only or file only
mode.
.RS
.RE
.TP
.B \-s
Sort files in natural order (Human perceivable order).
This option can be modified to use other sorting methods.
For example: \f[I]\-s/g\f[] or \f[I]\-\-sort/general\f[] will sort the
file in general (alphabetic) order.
Available sorting methods:
.RS
.IP
.nf
\f[C]
\-s\ \ \ \ :\ default\ sort\ (natural\ sort)
\-s/g\ \ :\ general\ sort
\-s/n\ \ :\ natural\ sort
\-s/mt\ :\ sort\ according\ to\ file\ modification\ time\ (recent\ first)
\-s/at\ :\ sort\ according\ to\ file\ access\ time\ (recent\ first)
\-s/ct\ :\ sort\ according\ to\ file\ status\ change\ time\ (recent\ first)
\-s/sz\ :\ sort\ according\ to\ file\ size\ (larger\ first)
\-s/d\ \ :\ prioritize\ directory\ when\ sorting
\-s/f\ \ :\ prioritize\ file\ when\ sorting
\-s/l\ \ :\ prioritize\ link\ when\ sorting
\-s/r\ \ :\ reverse\ the\ order\ sorted\ by\ above\ methods
\-s/no\ :\ No\ sort
\f[]
.fi
.RE
.TP
.B \-y
Confirm Yes to all and suppress output for every file.
.RS
.RE
.TP
.B \-u
Undo rename.
Undo depends on working directory.
If an \f[B]rnm\f[] command is run from ~/somedir, to undo this operation
one must run \f[B]rnm\f[] from the same directory again or provide the
path with \f[I]\-up\f[] option.
Undo is a very aggressive operation, it bypasses all security check.
.RS
.RE
.TP
.B \-up
Undo rename from a given path.
After every successful rename (or undo), the undo path is set to the
working directory where \f[B]rnm\f[] is run from.
.RS
.RE
.TP
.B \-ups
Show available undo paths.
.RS
.RE
.TP
.B \-q
Quiet operation (speedy operation, includes \f[C]\-y\f[]).
.RS
.RE
.TP
.B \-qq
Suppress even error messages.
.RS
.RE
.TP
.B \-f
Force rename.
Enables renaming some restricted files except \f[I]/\f[].
.RS
.RE
.TP
.B \-ff
Double force.
Bypass all restrictions.
.RS
.RE
.TP
.B \-\-
If this option is passed, anything and everything after it will be taken
as file path.
Put all options before it.
.RS
.RE
.TP
.B \-h
Show help menu.
.RS
.RE
.TP
.B \-v
Show version info.
.RS
.RE
.TP
.B \-sim
This runs a simulation of rename instead of actual rename operation.
.RS
.RE
.SH PROPERTIES OF OPTIONS
.PP
\f[B]Options are not sequential\f[] (except \f[C]\-h\f[], \f[C]\-v\f[],
\f[C]\-fl\f[], \f[C]\-nfl\f[] \f[C]\-u\f[], \f[C]\-up\f[],
\f[C]\-ups\f[], \f[C]\-duh\f[], \f[C]\-duhd\f[]).
.PP
For example, the two commands below are the same:
.IP
.nf
\f[C]
rnm\ filepath\ \-ns\ name
rnm\ \-ns\ name\ filepath
\f[]
.fi
.PP
\f[B]Giving the same type of option multiple times is sequential.\f[] If
an option is capable of overloading, it adds the given values
sequentially, on the other hand, if the option can not be overloaded, it
is overwritten.
For example:
.IP
.nf
\f[C]
rnm\ \-rs\ \[aq]/_/\-/g\[aq]\ \-rs\ \[aq]/\-/./g\[aq]\ ./*
\f[]
.fi
.PP
In above, the first replace string is applied first replacing all
underscores to hyphen, then the second one replaces all hyphens to dot.
The final result is: All underscores and hyphens is replaced with dot.
The behavior is the same if they are glued together with semicolon as a
delimiter (\f[C]\-rs\ \[aq]/_/\-/g;/\-/./g\[aq]\f[])
.PP
\f[B]Options \-h, \-v, \-duh and \-duhd are treated as First come, first
served\f[] and possess the highest priority.
.PP
\f[B]The behavior of \-fl\f[] (\f[I]\-\-follow\-link\f[]) and
\f[B]\-nfl\f[] (\f[I]no\-follow\-link\f[]) option depends on their
position.
For example:
.IP
.nf
\f[C]
rnm\ \-ns\ \[aq]/fn/\ /id/\[aq]\ link1\ \-fl\ link2\ \\
\ \ \ \ \-nfl\ link3\ link4\ \-fl\ \ link5\ link6
\f[]
.fi
.PP
will rename the symbolic links as:
.IP "1." 3
\f[I]link1\f[] will itself be renamed, it won\[aq]t be followed
.IP "2." 3
\f[I]link2\f[] will be followed and its target will be renamed because
\f[I]\-\-follow\-link\f[] flag was \f[B]set\f[] before it.
.IP "3." 3
\f[I]link3\f[] and \f[I]link4\f[] won\[aq]t be followed because
\f[I]\-\-follow\-link\f[] flag was \f[B]unset\f[] by \f[I]\-nfl\f[]
before these links.
.IP "4." 3
\f[I]link5\f[] and \f[I]link6\f[] will be followed because
\f[I]\-\-follow\-link\f[] flag was \f[B]set\f[] again before these
links.
.PP
\f[B]Priority of undo related options:\f[] \f[C]\-ups\f[] >
\f[C]\-up\f[] > \f[C]\-u\f[].
.PP
\f[B]Options are case insensitive\f[], i.e \f[I]\-ssF\f[] and
\f[I]\-ssf\f[] are the same.
.SH FULLY SPECIFIED NAMES FOR OPTIONS
.PP
All of the shorthand option names have equivalent full names.
The use of either of them is the same, i.e all option or sub\-option
should be separated with space.
The rule \-\-someopt=value won\[aq]t apply, instead \f[B]rnm\f[] uses
the syntax \f[B]\-\-someopts value\f[].
The following table shows the full names corresponding to the shorthand
names:
.PP
.TS
tab(@);
l l.
T{
Opt name
T}@T{
Full name
T}
_
T{
\-ns
T}@T{
\-\-name\-string
T}
T{
\-ns/f
T}@T{
\-\-name\-string\-file
T}
T{
\-ns/fn
T}@T{
\-\-name\-string\-file\-null\-terminated
T}
T{
\-l
T}@T{
\-\-line
T}
T{
\-sl
T}@T{
\-\-start\-line
T}
T{
\-el
T}@T{
\-\-end\-line
T}
T{
\-linc
T}@T{
\-\-line\-increment
T}
T{
\-ss
T}@T{
\-\-search\-string
T}
T{
\-ss/f
T}@T{
\-\-search\-string\-file
T}
T{
\-ssf
T}@T{
\-\-search\-string\-fixed
T}
T{
\-ssf/f
T}@T{
\-\-search\-string\-fixed\-file
T}
T{
\-rs
T}@T{
\-\-replace\-string
T}
T{
\-rs/f
T}@T{
\-\-replace\-string\-file
T}
T{
\-i
T}@T{
\-\-index
T}
T{
\-si
T}@T{
\-\-start\-index
T}
T{
\-ei
T}@T{
\-\-end\-index
T}
T{
\-inc
T}@T{
\-\-increment
T}
T{
\-if
T}@T{
\-\-index\-flags
T}
T{
\-ifp
T}@T{
\-\-index\-field\-precision
T}
T{
\-ifl
T}@T{
\-\-index\-field\-length
T}
T{
\-iff
T}@T{
\-\-index\-field\-filler
T}
T{
\-dp
T}@T{
\-\-depth
T}
T{
\-duh
T}@T{
\-\-delete\-undo\-history
T}
T{
\-duhd
T}@T{
\-\-delete\-undo\-history\-day
T}
T{
\-fo
T}@T{
\-\-file\-only
T}
T{
\-do
T}@T{
\-\-directory\-only
T}
T{
\-lo
T}@T{
\-\-link\-only
T}
T{
\-xd
T}@T{
\-\-exclude\-directory
T}
T{
\-xf
T}@T{
\-\-exclude\-file
T}
T{
\-xl
T}@T{
\-\-exclude\-link
T}
T{
\-fl
T}@T{
\-\-follow\-link
T}
T{
\-nfl
T}@T{
\-\-no\-follow\-link
T}
T{
\-cd
T}@T{
\-\-count\-directory
T}
T{
\-cf
T}@T{
\-\-count\-file
T}
T{
\-cl
T}@T{
\-\-count\-link
T}
T{
\-s
T}@T{
\-\-sort
T}
T{
\-s/g
T}@T{
\-\-sort/general
T}
T{
\-s/n
T}@T{
\-\-sort/natural
T}
T{
\-s/no
T}@T{
\-\-sort/none
T}
T{
\-s/mt
T}@T{
\-\-sort/mtime
T}
T{
\-s/at
T}@T{
\-\-sort/atime
T}
T{
\-s/ct
T}@T{
\-\-sort/ctime
T}
T{
\-s/d
T}@T{
\-\-sort/directory
T}
T{
\-s/f
T}@T{
\-\-sort/file
T}
T{
\-s/l
T}@T{
\-\-sort/link
T}
T{
\-s/sz
T}@T{
\-\-sort/size
T}
T{
\-s/r
T}@T{
\-\-sort/reverse
T}
T{
\-y
T}@T{
\-\-yes
T}
T{
\-u
T}@T{
\-\-undo
T}
T{
\-up
T}@T{
\-\-undo\-path
T}
T{
\-ups
T}@T{
\-\-undo\-path\-show
T}
T{
\-q
T}@T{
\-\-quiet
T}
T{
\-qq
T}@T{
\-\-quiet\-quiet
T}
T{
\-f
T}@T{
\-\-force
T}
T{
\-ff
T}@T{
\-\-force\-force
T}
T{
\-h
T}@T{
\-\-help
T}
T{
\-v
T}@T{
\-\-version
T}
T{
\-sim
T}@T{
\-\-simulation
T}
.TE
.SH TERMINOLOGY
.PP
These are the technical terms that will be thrown around a bit for
convenience.
.SS RESERVED INDEX
.PP
Index will be incremented even if any file is skipped renaming in order
to reserve the index for that skipped file.
These are constructed by appending the \f[C]r\f[] character with the
index identifier, e.g \f[I]/ir/\f[], \f[I]/\-idr/\f[] etc..
.SS REVERSE INDEX
.PP
Decrementing index.
These are constructed by inserting a \f[I]\-\f[] before the index
identifier e.g \f[I]/\-i/\f[], \f[I]/\-id/\f[] etc..
.SS NAME STRING
.PP
A string, that is parsed to create names for new files.
It can be fixed name which then can be modified for different files at
runtime.
Name sting is parsed by some rules (Name String Rule).
(must be wrapped around with filepath delimiter \f[I]/\f[]).
.SS NAME STRING RULE
.PP
A name string rule starts and ends with a \f[I]/\f[] character, These
special forms are parsed and expanded to their special meaning.
For example \f[I]/i/\f[] would expand to file index.
.SS INDEX RULES
.IP "1." 3
\f[I]/i/\f[] : Index.
.IP "2." 3
\f[I]/ir/\f[] : Reserved index.
.IP "3." 3
\f[I]/id/\f[] : Directory index (index inside a directory).
.IP "4." 3
\f[I]/idr/\f[] : Reserved directory index
.IP "5." 3
\f[I]/\-i/\f[] : Inverse index.
.IP "6." 3
\f[I]/\-ir/\f[] : Inverse reserved index.
.PP
In general, \f[I]\-i\f[] in the above name string rules will mean
inverse index conforming to their meaning.
.SS COUNTERS
.IP "1." 3
\f[I]/dc/\f[] : Directory count
.IP "2." 3
\f[I]/l/\f[] : Line number from \f[I]Name String File\f[].
.PP
Base conversion, scientific conversion and Latin conversions are
applicable on these counters.
See EXTENDED INDEX RULES.
.SS EXTENDED INDEX RULES
.PP
\f[B]Base conversion:\f[]
.IP
.nf
\f[C]
/<rule>\-b<base>/
\f[]
.fi
.PP
For example, \f[I]/i\-b8/\f[] will convert the index to octal.
<base> can be 2 to 36.
.PP
\f[B]Scientific conversion:\f[]
.IP
.nf
\f[C]
/<rule>\-s/
\f[]
.fi
.PP
For example, \f[I]/i\-s/\f[] will convert the index to scientific form
(n.fE+\-p)
.PP
\f[B]Latin conversion:\f[]
.IP
.nf
\f[C]
/<rule>\-l/
\f[]
.fi
.PP
For example, \f[I]/i\-l/\f[] will convert the index to Latin form.
.PP
\f[B]Examples:\f[]
.IP
.nf
\f[C]
#indexing:
rnm\ \-ns\ \[aq]/fn/\ /i/\[aq]\ ./*
#indexing\ by\ directory:
rnm\ \-ns\ \[aq]/fn/\ /id/\[aq]\ ./*
#indexing\ with\ binary\ number
rnm\ \-ns\ \[aq]/fn/\ /id\-b2/\[aq]\ ./*
#indexing\ with\ scientific\ number
rnm\ \-ns\ \[aq]/fn/\ /id\-s/\[aq]\ ./*
#indexing\ with\ latin\ number
rnm\ \-ns\ \[aq]/fn/\ /id\-l/\[aq]\ ./*
\f[]
.fi
.SS FILENAME
.IP "1." 3
\f[I]/fn/\f[] : Full name of the file.
.IP "2." 3
\f[I]/n/\f[] : File name without extension.
.IP "3." 3
\f[I]/e/\f[] : File extension.
.IP "4." 3
\f[I]/rn/\f[] : Replaced Name, generated by replace strings.
.IP "5." 3
\f[I]/pd/\f[] : Parent directory name of the current file or directory.
.IP "6." 3
\f[I]/wd/\f[] : Current working directory name.
.IP "7." 3
\f[I]/nsf/\f[]: Name (or name string) from name string file.
.SS EXTENDED PD RULES
.PP
Its general format is
.IP
.nf
\f[C]
/pd<digits>\-<digits>\-<delimiter>/
\ \ \ \ \ \ \ \ \ or
/pd<from>\-<to>\-<delimiter>/
\f[]
.fi
.PP
It specifies a bidirectional range of parent directories.
.IP "1." 3
\f[I]/pd0/\f[] is the immediate parent directory name, \f[I]pd1\f[] is
the directory before \f[I]pd0\f[] and so forth.
.IP "2." 3
\f[I]/pd0\-2\-+/\f[] will expand by concatenating pd0 to pd2 and with
the \f[I]delimiter\f[] in\-between (e.g \f[I]dir0+dir1+dir2\f[]).
.IP "3." 3
\f[I]/pd2\-0\-+/\f[] will do the same as above but in reverse order
(\f[I]dir2+dir1+dir0\f[]).
.IP "4." 3
In place of \f[I]<digits>\f[] you can supply \f[I]e\f[] which generally
means the \[aq]end\[aq] i.e the farthest level available from the
immediate parent.
.IP "5." 3
In place of \f[I]<digits>\f[] you can also supply \f[I]w\f[] which means
the level of working directory.
.IP "6." 3
Any unavailable level of directory will be ignored and be replaced with
empty string.
.PP
\f[B]Examples:\f[]
.IP
.nf
\f[C]
#Appending\ parent\ directory\ names
#with\ space\ in\-between
rnm\ \-ns\ \[aq]/pd0\-e\-\ /\[aq]\ ./*
rnm\ \-ns\ \[aq]/pdw\-0\-\ /\[aq]\ ./*
\f[]
.fi
.SS INFO\-NAME STRING RULE
.PP
This name string rule provides basic information about a file, directory
or link.