Jump to content

How to Copy, Move, and Manage Files in Termux (With Commands You Can Use)

Featured Replies

Posted

How to Copy, Move, and Manage Files in Termux (With Commands You Can Use)

If you're using Termux on your Android phone, you can manage files just like on a computer. In this post, you will learn how to copy, move, rename, delete, and create files or folders using simple commands in Termux.

Let’s get started.

Give Termux Access to Your Storage

Before managing files, allow Termux to access your internal storage.

Command:

arduino
CopyEdit
termux-setup-storage

Copy a File

To copy a file from one folder to another, use the command below.

Command:

bash
CopyEdit
cp myfile.txt /sdcard/

To copy it into another folder:

bash
CopyEdit
cp myfile.txt Documents/

Move a File

To move a file from one folder to another:

Command:

bash
CopyEdit
mv myfile.txt Downloads/

Rename a File

To rename a file:

Command:

bash
CopyEdit
mv oldname.txt newname.txt

Delete a File

To delete a file:

Command:

bash
CopyEdit
rm myfile.txt

To delete a folder and all files inside it:

Command:

bash
CopyEdit
rm -r myfolder/

Create a New Folder

To make a new folder:

Command:

arduino
CopyEdit
mkdir mynewfolder

Enter a Folder

To go into a folder:

Command:

bash
CopyEdit
cd Downloads

To go back to the previous folder:

Command:

bash
CopyEdit
cd ..

To go to the main Termux folder:

Command:

bash
CopyEdit
cd ~

Show Files in a Folder

To list the files in the current folder:

Command:

bash
CopyEdit
ls

Final Notes

These are the most basic and useful commands to manage files and folders using Termux. With these, you can easily copy, move, delete, and organize your files right from your Android phone.



Create an account or sign in to comment