Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 May 2001 19:14:29 -0500
From:      Andrew Hesford <ajh3@usrlib.org>
To:        Francois Kritzinger <ffkrz@iafrica.com>
Cc:        Andrew Hesford <ajh3@usrlib.org>, freeBSD Mailing List <questions@freeBSD.org>
Subject:   Re: COPY, CUT, PASTE (FILES)
Message-ID:  <20010512191429.A3099@core.usrlib.org>
In-Reply-To: <3AFDA17D.377416FA@iafrica.com>; from ffkrz@iafrica.com on Sat, May 12, 2001 at 10:47:57PM %2B0200
References:  <3AFCE758.63DE32E1@iafrica.com> <20010512141419.A2406@core.usrlib.org> <3AFDA17D.377416FA@iafrica.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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<tab>/fil<tab> .

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<tab><tab><tab>/fil<tab><tab> .

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010512191429.A3099>