Differences

This shows you the differences between the selected revisions of the page.

2022-05-04 2022-05-05
Added warning about partial loss of filename for names that contain multiple dots. (76.167.224.130) do not lose filename parts between first and last dot (martin)
Line 170: Line 170:
==== Backup a File with Current Date and Time ==== ==== Backup a File with Current Date and Time ====
<code custom-command-remote> <code custom-command-remote>
-cp ! $(echo "!" | sed "s/\..*$//").$(date '+%Y-%m-%d_%H-%M').$(echo ! | awk -F"." '{ print $NF }')+cp ! $(echo "!" | sed "s/\.[^.]*$//").$(date '+%Y-%m-%d_%H-%M').$(echo ! | awk -F"." '{ print $NF }')
</code> </code>
-Note that you will lose a portion of the file name for files with multiple dots ( **.'s** ). 
==== Rename a File with Current Date and Time ==== ==== Rename a File with Current Date and Time ====
<code custom-command-remote> <code custom-command-remote>
-mv ! $(echo "!" | sed "s/\..*$//").$(date '+%Y-%m-%d_%H-%M').$(echo ! | awk -F"." '{ print $NF }')+mv ! $(echo "!" | sed "s/\.[^.]*$//").$(date '+%Y-%m-%d_%H-%M').$(echo ! | awk -F"." '{ print $NF }')
</code> </code>
-Note that you will lose a portion of the file name for files with multiple dots ( **.'s** ). 
===== [[fxp]] Remote Transfer (FXP) ===== ===== [[fxp]] Remote Transfer (FXP) =====

Last modified: by martin