TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

47 点作者 busterc超过 10 年前

7 条评论

throwaway0x01超过 10 年前
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 未加载
daGrevis超过 10 年前
It&#x27;s interesting that this software is using NPM as package manager even if it&#x27;s written in Shell itself.
muxxa超过 10 年前
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.
fyolnish超过 10 年前
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>
ashishb4u超过 10 年前
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.
sillysaurus3超过 10 年前
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 未加载
kenshaw超过 10 年前
No one knows about xsel anymore?
评论 #8829062 未加载