Kompx.com or Compmiscellanea.com

Renaming files in DOS

Operating systems : MS-DOS 6.0+ [ 1 ]

Renaming files in DOS by REN command

REN FILE1.TXT FILE2.TXT

- Renames FILE1.TXT into FILE2.TXT

REN FILE1.TXT FILE2.HTM

- Renames FILE1.TXT into FILE2.HTM

REN *.TXT *.HTM

- Renames all files with .txt extension into files with .htm extension. Only extensions are changed, the file names proper are left as they were.

Since REN is the shorter form of RENAME command, RENAME may be used instead - as more self-explaining may be.

Renaming files in DOS by MOVE command

MOVE FILE1.TXT FILE2.TXT

- Renames FILE1.TXT into FILE2.TXT

MOVE FILE1.TXT FILE2.HTM

- Renames FILE1.TXT into FILE2.HTM

Both methods of file renaming work in Windows command prompt as well. But there is a certain distinction: MS-DOS, other typical / older DOS'es, command prompt of Windows prior to Windows 95 and Windows NT 3.51 use a short filename / 8.3 filename convention. So, for example, REN FILE1.HTM FILE1.HTML is not going to work, there will be "Duplicate file name or file name not found" message. And that is not the case with newer DOS'es or command prompt of newer Windows. It can be not the case in older DOS'es also - if relevant drivers are installed.


[ 1 ]

MS-DOS 6.0+ tested - but it also may happen to work well under other versions of MS-DOS or other DOS'es.


Aliosque subditos et thema

 

Unzip multiple files. Linux

 

Unzip multiple zip files into one directory by Linux command line unzip. Contrary to possible expectations, "unzip *.zip" is not going to work, *.zip should be put into quotes: unzip "*.zip" There may be files with the same names in these archives. To avoid overwriting: unzip -B "*.zip" "Unzip -B" makes unzip to overwrite duplicates during extraction process, but saving a backup copy of each overwritten file. The names for these backup copy files are created by adding tilde ("~") at the end of the original names of the files. If a file extension is present, then "~" is added after it. If that is not enough, unique sequence number (up to 5 digits) is appended after the "~". "Unzip -B" is not too practical. For example, since when the sequence number range for numbered backup files gets exhausted (99999, or 65535 for 16-bit systems), the backup file with the maximum sequence number is deleted and replaced by the new backup version without notice ( More on the subject ). The number of files in an archive may not be always known in advance or may be more than possible sequence number range, so "Unzip -B" is not a great choice. Renaming duplicate files by adding "~" at the end of their names, after the extension, is not too convenient either. But another built-in option is even worse. If the "-B" modifier is not used, each time a file with same name as there already unpacked is being extracted, unzip asks "replace example.txt? [y]es, [n]o, [A]ll, [N]one, [r]ename:". And each time "r" must be hit, then a new name has to be input. So some bash or another script solving the problem should probably be prepared and used instead.

CSS centering absolutely positioned elements

 

CSS horizontal centering of an absolutely positioned element. Example: HTML / XHTML. Code: <div class="example"> <img src="image.jpg" alt="Image" /> </div> CSS. Code: .example {position: relative; left: 0px; top: 0px; height: 90px; width: 100%; float: left; padding: 10px; border: 1px #ccc solid; background: #fafafa; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; -ms-box-sizing: border-box; box-sizing: border-box;} .example img {position: absolute; left: 0px; right: 0px; margin: 0px auto; width: 68px;} An absolutely positioned img is centered in the example. But this method of horizontal centering also works with other both inline and block absolutely positioned elements. The width of an absolutely positioned element may also be in percent or other units. CSS properties of a container (here it is .example), holding an element to be centered, may vary. The element's centering is achieved by styles applied to the element itself: .example img {position: absolute; left: 0px; right: 0px; margin: 0px auto;}. [ 1 ] As well as Netscape 8.01+, Mozilla 1.5+. [ 2 ] As well as Netscape 8.01+, Mozilla 1.5+.