I have two questions. First, which command lists files and directories, but lists directories first?
Second question: I want to copy a list of files into a single directory, but make the target directory the first filename in the command.
|
I have two questions. First, which command lists files and directories, but lists directories first? Second question: I want to copy a list of files into a single directory, but make the target directory the first filename in the command. |
||||
Got GNU?The gnu version of No GNU?On systems that don't have gnu's
For copying files, with the target first, you would have to write a script that saves the first argument, then uses
Watch Out!If you were planning on using these together - that is, collecting the list from An alternative tool for efficiently copying directory trees.You might want to look into using |
|||||||
|
|
Listing directories first for a non-GNU
Note, this will list all the bunch of other weird stuff like symlinks, sockets and pipes as well (appropriately grouped, of course), but considering that stuff is quite rare that shouldn't be a problem. Otherwise the filter would be |
|||
|
|
lshas a--group-directories-firstswitch. – jasonwryan Oct 18 '11 at 0:27-tis a possibly a GNU-only option tocpthat takes an explicit target directory and hence can go anywhere in the command line, including the beginning. – jw013 Oct 18 '11 at 1:23