Right-click "send to another computer" under Ubuntu"

Source: Internet
Author: User
Tags scp command
First, if the system is normal, in the latest Ubuntu10.04, right-click a USB flash drive, connect to a bluetooth device on the computer, share folders on other mounted computers, send emails, and send emails to CD/DVD creators. When we select a file, the right-click menu will contain a "send ..." After clicking, you will see a window. The "email" drop-down menu under the "purpose" item does not mean that it is only sent by email, it actually has all the features I mentioned above. We just want to send

First, if the system is normal, under the latest Ubuntu 10.04, right-click a USB flash drive, connect to a bluetooth device on the computer, share folders on other mounted computers, send emails, and send emails to CD/DVD creators.

When we select a file, the right-click menu will contain a "send ..." After clicking, you will see a window. The "email" drop-down menu under the "purpose" item does not mean that it is only sent by email, it actually has all the features I mentioned above.

We only want to send the data to the USB flash drive independently. We also hope that you can right-click the data to directly transfer the data to another computer on the LAN.

By using commands or scripts, we can simply add a "send to other computers" option in the context menu to facilitate users in the LAN to transfer things to another computer.

Right-click menu items. There are two simple methods: nautilus-scripts and nautilus-actions.

Transmission Mode: Use ssh, that is, the scp command.

The preparation is to install ssh on the computer to be uploaded. If possible, it is best to configure the password-free access, but it does not matter if it is not configured. You can enter the password when you enter the password.

1. nautilus-scripts Method

Does this seem to be the default Ubuntu?

Put the script in ~ /. Gnome2/nautilus-scripts directory.

Script content:

#! /Bin/bash

Names = $ (echo $ NAUTILUS_SCRIPT_SELECTED_FILE_PATHS | sed's/\ n // G ')

Cmd = "/usr/bin/scp-r $ names username @ IP or host name :"

Gnome-terminal -- title = $ title -- hide-menubar -- geometry 100x5 + 440 + 200-x bash-c "$ cmd; sleep 3 s"

Name.

Make sure that this file is executable: Right-click --> Property --> permission, and select the execution item.

Requirement: gnome-terminal (default Ubuntu terminal) is installed ).

Advantage: You can transfer multiple files or folders. www.linuxidc.com can display the transfer speed and progress for large files or folders.

Disadvantage: In the "script" subdirectory of the right-click menu, there cannot be spaces in the file name; prompt, speed, progress, and other information are displayed in the terminal, and some may not like it.

If zenity is used, I didn't handle the progress bar and speed, so I simply used the terminal to display it.

In the same way, you can "send to a USB flash drive ". This is a compressed script package implemented by someone else using zenity:

Decompress the package and put it ~ /. Gnome2/nautilus-scripts directory and ensure it can be executed.

However, it does not display the progress and speed of large files, which is unpleasant.

However, when you use the command cp to copy files, there is no speed or progress prompt, so you must implement it yourself. It is better to simply use the system default or use it together.

2. nautilus-actions

This software package needs to be installed.

Sudo apt-get install nautilus-actions

Then you can click system> preference> Nautilus action configuration to open the graphical management interface.

Let's explore the rest.

The most important is the Command to implement scp:/usr/bin/scp

Parameter (Parameters): % f username @ ip or host name

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.