Questions about using cp or mv in Puppy

Booting, installing, newbie
Post Reply
Message
Author
pewekodok
Posts: 14
Joined: Fri 24 May 2013, 00:14

Questions about using cp or mv in Puppy

#1 Post by pewekodok »

I want to ask about 2 things.

1. is puppy never give me overwrite warning? when I gave

Code: Select all

cp a.txt b.txt
or

Code: Select all

mv a.txt b.txt
, suppose b.txt exists, then puppy simply overwrite it w/o ask me to overwrite. or is just root mode behavior?

2. is it possible to send file to trash? right click a file in ROX file manager then "File" only "Delete" listed no "Send to trash". I see trash icon on desktop, is there any use? If I press del on keyboard, will file be sent to trash or simply deleted?

fyi I use frugal installed Precise 5.5

best regards
R-S-H
Posts: 487
Joined: Mon 18 Feb 2013, 12:47

#2 Post by R-S-H »

Hi.

If you are typing 'cp --help' or 'mv --help' into a terminal it will offer you some options for the use of 'cp' and 'mv', as there are options not to overwrite a file and/or to overwrite only older files (replaced by the newer version).

Don't know anything about sending files to trash using bash - uups, a rhyme... :lol:

RSH
[b][url=http://lazy-puppy.weebly.com]LazY Puppy Home
The new LazY Puppy Information Centre[/url][/b]
User avatar
rjbrewer
Posts: 4405
Joined: Tue 22 Jan 2008, 21:41
Location: merriam, kansas

Re: Questions about using cp or mv in Puppy

#3 Post by rjbrewer »

pewekodok wrote:
2. is it possible to send file to trash? right click a file in ROX file manager then "File" only "Delete" listed no "Send to trash". I see trash icon on desktop, is there any use? If I press del on keyboard, will file be sent to trash or simply deleted?

fyi I use frugal installed Precise 5.5

best regards
Left click file.
Drag to trash can.
Right click trash can.
Empty trash.
Delete.

Inspiron 700m, Pent.M 1.6Ghz, 1Gb ram.
Msi Wind U100, N270 1.6>2.0Ghz, 1.5Gb ram.
Eeepc 8g 701, 900Mhz, 1Gb ram.
Full installs
User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#4 Post by tallboy »

Hi pewekodok.
Re: mv and cp

I hope you are aware of that puppy uses BusyBox, which provides a minimalistc version of the commands and utilities normally provided by coreutils. You may find it as an sfs or .pet in the forum, make a search for coreutils.
I have seen in posts from other members, that if you install the full version of coreutils in puppy, you may experience problems with identical commands that are linked to BusyBox.

BusyBox - The Swiss Army Knife of Embedded Linux Describes all functions and commands

http://en.wikipedia.org/wiki/BusyBox

Re: trash vs. delete
It surprises me that Trash is not available in the upper part of the menu when you right click on a file that you want to move to trash (like new.txt below). In the upper part of the menu, choose Customize Menu. The windows shown below will appear, and you add Trash to the /root/.config/rox.sourceforge.net/SendTo directory. Trash is found in /usr/local/apps/ in my LupuPlus_528, I would guess it is the same in other puppys. Drag Trash to the SendTo window, and choose as a Link (relative) in the dialog window. Close the windows and see if it is in the menu when you right-click a file. If not, run fixmenus in a terminal window.

BTW, if you open the /root/.config/rox.sourceforge.net/ window, and click on the 'eye' symbol in the menu line to see all files, you will find a directory for each type of files that can have their own menu. Just open the dirs and take a look, and drag a trash link into those you feel need it.

Please report back if you make it work.

tallboy
Attachments
customize.jpg
(51.02 KiB) Downloaded 350 times
link.jpg
(47.68 KiB) Downloaded 355 times
True freedom is a live Puppy on a multisession CD/DVD.
pewekodok
Posts: 14
Joined: Fri 24 May 2013, 00:14

#5 Post by pewekodok »

hello tallboy
tallboy wrote: I hope you are aware of that puppy uses BusyBox, which provides a minimalistc version of the commands and utilities normally provided by coreutils.
thanks to tell me about busybox. Never thought it ever used in desktop pc. I ever installed busybox on android tablet.

okay let me explore busybox again and coreutils.
tallboy wrote: It surprises me that Trash is not available in the upper part of the menu when you right click on a file that you want to move to trash (like new.txt below). In the upper part of the menu, choose Customize Menu. The windows shown below will appear, and you add Trash to the /root/.config/rox.sourceforge.net/SendTo directory. Trash is found in /usr/local/apps/ in my LupuPlus_528,
the idea sound good, then I tried to customize menu. After that I hestitated to continue, because each file type will get each send-to directory. as the picture you attach for plain-text type. Then customize menu for directory wil create .inod-dir send-to directory.

many thanks tallboy
User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#6 Post by tallboy »

Run /usr/local/apps/Trash/Help/help.html. Trashed items are just moved to /root/.Trash, and can be handled as any other file or dir if you restore them. (restore move them back to original dir) The Trash File Information window, shown at the bottom of the screenshot, open if you left-click an item in /root/.Trash.
BTW, this is one of the advantages of running from a live CD, if anything crashes during experimentation, I just reboot or restart the disc. :D

tallboy
Attachments
screenshot.jpg
(77.87 KiB) Downloaded 282 times
True freedom is a live Puppy on a multisession CD/DVD.
User avatar
SFR
Posts: 1799
Joined: Wed 26 Oct 2011, 21:52

#7 Post by SFR »

pewekodok wrote:[...]I tried to customize menu. After that I hestitated to continue, because each file type will get each send-to directory.[...]
Some time ago I wrote a small script to automate the process of adding (or removing) 'Trash' entry to right-click menu.
See this post: http://murga-linux.com/puppy/viewtopic. ... 442#678442

As for cp/mv you can use -i (interactive) param, eg.:

Code: Select all

# cp -i file1 file2
cp: overwrite ‘file2’?
As RSH suggested, type 'cp --help' for more...

HTH
Greetings!
[color=red][size=75][O]bdurate [R]ules [D]estroy [E]nthusiastic [R]ebels => [C]reative [H]umans [A]lways [O]pen [S]ource[/size][/color]
[b][color=green]Omnia mea mecum porto.[/color][/b]
disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#8 Post by disciple »

I'd say you already have the information you need, but to address a bunch of the questions that have been raised:

1. Generally speaking puppy is designed to always run as root.
Do cp and mv give warning prompts if you run (in any distro) as a "normal user"? I didn't think they did, but then I've never run any Linux not as root to test...
2. Assuming you don't want to patch Rox so that delete actually sends the file to the Trash (I seem to recall that someone has actually done that), you can add the trash roxapp to the "Send to" menu as mentioned.
Pressing delete on the keyboard isn't the normal key binding for delete in Rox, anyway. Normally it is Ctrl-X, and it will properly delete the file, not send it to the Trash.

I don't see that Busybox is relevant here.

One other option is to use libtrash, which will affect cp commands as well as any gui programs. It is completely different from the Trash roxapp... and they are both completely different from the freedesktop trash standard, which is implemented in major desktop environments.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#9 Post by don570 »

I found out the hard way that older versions of Puppy linux

don't support the command

Code: Select all

mv -n 
All versions support

Code: Select all

mv -i 
because busybox supports it.
User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#10 Post by tallboy »

Hi disciple.
You wrote:Do cp and mv give warning prompts if you run (in any distro) as a "normal user"?
No, I have used them in Debian and RedHat as user since I started with Linux, and I have never heard about restrictions.
You also wrote:I don't see that Busybox is relevant here.
Yes, and No. I wrote that puppy uses BusyBox, but when I checked my /bin directory, it looked as in the image of a section of my /bin directory shown below. Files marked BB are BusyBox versions, and when hovering the mouse over them, it say it is a symlink to busybox. When I write mv in the terminal and tab twice, it says:

Code: Select all

# mv        
mv             mv-BB-NOTUSED  
# mv
The problem is that I have remastered my puppy several times, so I am not sure if coreutils are installed by default, or not. I know that my dpup_484beta4 would not use the same full commands as I used in my Debian. I think it may depend on which puppy you use. Any feedback regarding your puppy version would be welcome.
Here is the BusyBox version of mv:

Code: Select all

mv
    mv [OPTIONS] SOURCE DEST or: mv [OPTIONS] SOURCE... DIRECTORY
    Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY
    Options:
            -f      Don't prompt before overwriting
            -i      Interactive, prompt before overwrite
Here is the full version:

Code: Select all

mv(1) - Linux man page
Name
mv - move (rename) files
Synopsis
mv [OPTION]... [-T] SOURCE DEST
mv [OPTION]... SOURCE... DIRECTORY
mv [OPTION]... -t DIRECTORY SOURCE...
Description
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
Mandatory arguments to long options are mandatory for short options too.
--backup[=CONTROL]
    make a backup of each existing destination file 
-b
    like --backup but does not accept an argument 
-f, --force
    do not prompt before overwriting 
-i, --interactive
    prompt before overwrite 
-n, --no-clobber
    do not overwrite an existing file
If you specify more than one of -i, -f, -n, only the final one takes effect.
--strip-trailing-slashes
    remove any trailing slashes from each SOURCE argument 
-S, --suffix=SUFFIX
    override the usual backup suffix 
-t, --target-directory=DIRECTORY
    move all SOURCE arguments into DIRECTORY 
-T, --no-target-directory
    treat DEST as a normal file 
-u, --update
    move only when the SOURCE file is newer than the destination file or when the destination file is missing 
-v, --verbose
    explain what is being done 
--help
    display this help and exit 
--version
    output version information and exit
The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX. The version control method may be selected via the --backup option or through the VERSION_CONTROL environment variable. Here are the values:
none, off
    never make backups (even if --backup is given) 
numbered, t
    make numbered backups 
existing, nil
    numbered if numbered backups exist, simple otherwise 
simple, never
    always make simple backups
The man page for cp is much longer, so I won't take up the space here. You can see that the BusyBox versions are very limited compared to the full versions, so it clearly matters if your puppy only have the BusyBox versions.

tallboy
Attachments
binfiles.jpg
(41.64 KiB) Downloaded 196 times
True freedom is a live Puppy on a multisession CD/DVD.
disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#11 Post by disciple »

Code: Select all

mv -n
Ah, I see. Thanks.[/quote]
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
Post Reply