Linux uuto Command with Practical Examples

LinuxLinuxBeginner
Practice Now

Introduction

In this lab, we will explore the Linux uuto command, which is a utility used for securely sending files between remote systems. The uuto command is part of the uucp (Unix-to-Unix Copy) suite of tools, providing a way to transfer files and execute remote commands over a network. We will learn how to use the uuto command to send and receive files, as well as understand its basic syntax and common options.

The lab covers the following steps:

  1. Introduction to the uuto command
  2. Sending files using the uuto command
  3. Receiving files with the uuto command

Linux Commands Cheat Sheet


Skills Graph

%%%%{init: {'theme':'neutral'}}%%%% flowchart RL linux(("`Linux`")) -.-> linux/FileandDirectoryManagementGroup(["`File and Directory Management`"]) linux(("`Linux`")) -.-> linux/BasicFileOperationsGroup(["`Basic File Operations`"]) linux(("`Linux`")) -.-> linux/RemoteAccessandNetworkingGroup(["`Remote Access and Networking`"]) linux/FileandDirectoryManagementGroup -.-> linux/cd("`Directory Changing`") linux/BasicFileOperationsGroup -.-> linux/ls("`Content Listing`") linux/BasicFileOperationsGroup -.-> linux/cp("`File Copying`") linux/BasicFileOperationsGroup -.-> linux/rm("`File Removing`") linux/RemoteAccessandNetworkingGroup -.-> linux/ssh("`Secure Connecting`") linux/RemoteAccessandNetworkingGroup -.-> linux/scp("`Secure Copying`") linux/RemoteAccessandNetworkingGroup -.-> linux/sftp("`Secure File Transferring`") subgraph Lab Skills linux/cd -.-> lab-422995{{"`Linux uuto Command with Practical Examples`"}} linux/ls -.-> lab-422995{{"`Linux uuto Command with Practical Examples`"}} linux/cp -.-> lab-422995{{"`Linux uuto Command with Practical Examples`"}} linux/rm -.-> lab-422995{{"`Linux uuto Command with Practical Examples`"}} linux/ssh -.-> lab-422995{{"`Linux uuto Command with Practical Examples`"}} linux/scp -.-> lab-422995{{"`Linux uuto Command with Practical Examples`"}} linux/sftp -.-> lab-422995{{"`Linux uuto Command with Practical Examples`"}} end

Introduction to the uuto Command

In this step, we will explore the uuto command, which is a utility in Linux used for securely sending files between remote systems. The uuto command is part of the uucp (Unix-to-Unix Copy) suite of tools, which provide a way to transfer files and execute remote commands over a network.

The uuto command is designed to work with the uux command, which allows users to execute remote commands on other systems. Together, these tools can be used to create a secure and reliable file transfer system between Linux machines.

Let's start by understanding the basic syntax of the uuto command:

uuto [options] source_file destination_user@remote_host

The source_file is the file you want to send, and the destination_user@remote_host is the recipient's username and the remote system's hostname or IP address.

Some common options for the uuto command include:

  • -m: Send a notification email to the sender when the file transfer is complete.
  • -n: Do not send a notification email.
  • -r: Remove the source file after a successful transfer.

Now, let's try a simple example. Suppose we want to send a file named example.txt from the current directory to a remote user named remote_user on a system with the hostname remote_host.

uuto example.txt remote_user@remote_host

Example output:

sending file example.txt to remote_user@remote_host ...

In this example, the uuto command will initiate the file transfer to the remote system. The actual transfer process may take some time, depending on the file size and network conditions.

Sending Files Using the uuto Command

In this step, we will learn how to use the uuto command to securely send files to a remote system.

First, let's create a sample file to transfer:

echo "This is a test file." > example.txt

Now, let's send the example.txt file to a remote user named remote_user on a system with the hostname remote_host:

uuto example.txt remote_user@remote_host

Example output:

sending file example.txt to remote_user@remote_host ...

The uuto command will initiate the file transfer to the remote system. The actual transfer process may take some time, depending on the file size and network conditions.

You can also use additional options with the uuto command, such as:

  • -m: Send a notification email to the sender when the file transfer is complete.
  • -n: Do not send a notification email.
  • -r: Remove the source file after a successful transfer.

For example, to send the file and remove the source file after a successful transfer, you can use:

uuto -r example.txt remote_user@remote_host

This will send the example.txt file to the remote system and delete the local copy of the file.

Receiving Files with the uuto Command

In this step, we will learn how to use the uuto command to receive files from a remote system.

On the remote system, the user should have sent a file using the uuto command, as we practiced in the previous step. Now, let's check for any incoming files on our local system.

The uuto command stores incoming files in the /var/spool/uucppublic directory by default. Let's navigate to this directory and list the contents:

cd /var/spool/uucppublic
ls -l

Example output:

total 4
-rw-rw-r-- 1 labex labex 20 Apr 12 12:34 example.txt

In this example, we can see that the example.txt file has been received from the remote system.

To retrieve the file, we can use the uupick command:

uupick example.txt

Example output:

[OK] example.txt

The uupick command will move the received file from the /var/spool/uucppublic directory to the current working directory.

You can also use the uupick command with the -m option to automatically move the received files to a specific directory:

uupick -m ~/received_files example.txt

This will move the example.txt file to the ~/received_files directory.

Summary

In this lab, we learned about the uuto command, a utility in Linux used for securely sending files between remote systems. We explored the basic syntax of the uuto command, including the options to send notification emails and remove the source file after a successful transfer. We also practiced sending a sample file named example.txt from the current directory to a remote user on a remote system. Finally, we learned how to receive files using the uuto command on the remote system.

Linux Commands Cheat Sheet

Other Linux Tutorials you may like