TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: XCV – cut, copy and paste files with bash

47 pointsby bustercover 10 years ago

7 comments

throwaway0x01over 10 years ago
Apologies ahead of time for grammar and spelling, I am on a phone.<p>This is a really cool idea, although you would you be willing to implement it using a file which would cache the cut&#x2F;copy operations until a paste is done?<p>As it stands, whether you copy or cut the underlying operation is a cp. This means no matter what you pay the price of creating a copy of each file. There are a couple of ramifications of this, that I can think of at least. One, surprising labeling of files - selinux labels are dependent on how files are created. As such a move does not create new labels, where a copy does. Depending on what the operation is, the user might want to retain or remove the existing label. As it stands, the user cannot do the former. It is also possible that a file cannot be copied&#x2F;moved to the home directory but to the destination directory only. Two, loss of filesystem move advantage. When you move a file within the same filesystem all that happens is a new link is created in the directory and the old one is deleted. This means the data of the file goes no where. Generally the &quot;copy then delete&quot; method is used between file systems. By doing this manually you cause this process to happen all the time. Worse, it is possible the SRC, HOME, and DST are all different file system, so this would cause three different copies.<p>However, if you implement a file within the HOME&#x2F;.xcv directory which contains the source and the method of transfer you can make the transfer a direct source to destination affair.<p>Overall, I really like this project - could have saved a lot of time with it. Good luck!
评论 #8825816 未加载
daGrevisover 10 years ago
It&#x27;s interesting that this software is using NPM as package manager even if it&#x27;s written in Shell itself.
muxxaover 10 years ago
The copy&#x2F;cut&#x2F;paste paradigm is ubiquitous, but I&#x27;ve always thought that a better model would be mark&#x2F;duplicate&#x2F;move.<p>Where copy+paste is achievable by mark+duplicate and cut+paste by mark+move.<p>That way you don&#x27;t have the danger of losing cut content if you forget to paste.
fyolnishover 10 years ago
Something like this would be less likely to accidentally delete files (copy copy paste just purges the list, not the actual files): <a href="https://gist.github.com/fjolnir/e24f806e39a3776033d5" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;fjolnir&#x2F;e24f806e39a3776033d5</a>
ashishb4uover 10 years ago
I wrote something similar sometime back: <a href="https://github.com/ashisha/x-cut-copy-paste" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ashisha&#x2F;x-cut-copy-paste</a><p>But the ability to list the files being copied is brilliant indeed.
sillysaurus3over 10 years ago
Cool project!<p>What about a syntax like:<p><pre><code> Copy all files recursively: xcv . Cut all files recursively: xcv -x . List all files which will be pasted: xcv -l Paste all copied files elsewhere: xcv -v &#x2F;elsewhere </code></pre> It&#x27;s just that most people will want to do those things by default, and remembering &quot;xcv c -R .&quot; is a bit more mental effort than &quot;xcv .&quot; But maybe that&#x27;s just a personal preference.
评论 #8825518 未加载
评论 #8825484 未加载
评论 #8826312 未加载
kenshawover 10 years ago
No one knows about xsel anymore?
评论 #8829062 未加载