Better Practice When Working With Files
Hey,
I have a question that I ran into when working with files on my linux box. I went ahead and pasted what I have in terminal. MacBookPro:Test random0munky$ ls -l total 0 -rw-r--r-- 1 random0munky staff 0 Jul 31 19:31 myTest -rw-r--r-- 1 random0munky staff 0 Jul 31 19:31 myTest.new MacBookPro:Test random0munky$ mv myTest myTest.orig MacBookPro:Test random0munky$ mv myTest.new myTest MacBookPro:Test random0munky$ ls -l total 0 -rw-r--r-- 1 random0munky staff 0 Jul 31 19:31 myTest -rw-r--r-- 1 random0munky staff 0 Jul 31 19:31 myTest.orig MacBookPro:Test random0munky$ I feel there's a better way / using better practices to accomplish the same task. What do you guys think? Edit: I noticed that when you do the mv command, that the permissions as well as the group doesn't update with the file. Now just need to see about how to go about updating those 2 values. |
Hi,
how about Code:
mv -b -S '.orig' myTest.new myTest Evo2. |
Quote:
Edit: How about this: mv -b -S '.orig' myTest.new myTest | chmod --reference myTest.orig myTest |
Hi,
Quote:
Code:
mvbk () { Code:
mvbk myTest.new myTest eg Code:
mvbk () { Code:
mvbk myTest |
Quote:
|
Hi,
Quote:
Cheers, Nick. |
All times are GMT -5. The time now is 02:26 AM. |