From owner-freebsd-questions Sat May 12 17:15:27 2001 Delivered-To: freebsd-questions@freebsd.org Received: from core.usrlib.org (CC2-861.charter-stl.com [24.217.115.99]) by hub.freebsd.org (Postfix) with ESMTP id 5451F37B43F for ; Sat, 12 May 2001 17:15:23 -0700 (PDT) (envelope-from ajh3@core.usrlib.org) Received: by core.usrlib.org (Postfix, from userid 1001) id 13A8AA814; Sat, 12 May 2001 19:14:29 -0500 (CDT) Date: Sat, 12 May 2001 19:14:29 -0500 From: Andrew Hesford To: Francois Kritzinger Cc: Andrew Hesford , freeBSD Mailing List Subject: Re: COPY, CUT, PASTE (FILES) Message-ID: <20010512191429.A3099@core.usrlib.org> References: <3AFCE758.63DE32E1@iafrica.com> <20010512141419.A2406@core.usrlib.org> <3AFDA17D.377416FA@iafrica.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3AFDA17D.377416FA@iafrica.com>; from ffkrz@iafrica.com on Sat, May 12, 2001 at 10:47:57PM +0200 X-Loop: Andrew Hesford Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sat, May 12, 2001 at 10:47:57PM +0200, Francois Kritzinger wrote: > OK then, picture this: > > You are in ~/, and you see a file that you want to move someplace else, but > you don't know where yet. > > LONG way: > Browse directory structure untill destination is found > type "mv whole_long_path_that > _may_be_so_long_that_you_might_have_to_type_a_whole_lot/filename > destination" > > SHORT and EASY and IMO BETTER way: > type "cut filename" > browse directory structure until destination is found > type "paste filename" > > As you can easily see, the second way may save you quite a substantial > amount of typing. > And IMO that is a useful feature to have. > > Also you can call the cut command anything you like. How about "take" or > "grab" ? > > But regardless all I really wanted to know was whether or not there was a > command like that in Unix. > Here's my way: mv who/fil . Short and sweet. Remember that tab-completion is very, very often your friend. I am so dependent on it, I can't use a shell without it without cursing after 10 seconds. And as far as needing to type enough to uniquely identify the file, well, I have rarely ever had to type more than five characters. Alternatively, with zsh, you can tab-cycle through the names, so you might wind up with: mv who/fil . which is still no trouble. The only appropriate name for a command that you talk about would be "cache", since that is what you are doing--cachine the file. Since this is an open UNIX, and UNIX was designed to be customized, why don't you write such a utility and contribute it to the base (assuming they will incorporate it)? Create a directory called /var/cache or something, and then when you do `cache filename` it would move (or copy) the file into /var/cache. Then a simple `drop-cache` would dump the cached file into the current directory. Since the task is so simple, it wouldn't even need to take a fancy utility; only a pair of shell scripts (or, if you are fancy, one shell script and one symlink). -- Andrew Hesford ajh3@usrlib.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message