How to manage files in the android terminal

The android command line can be rich featured thanks to Linux, in order to get a terminal with a Linux environment I recommend you to install Termux available in F-droid as well as the Play Store.

Its very important to use the Linux commands in your Android since it will help you to use Free and Open source software instead of the untrusty privative software.

In zsh.li/cat I showed you that I Installed only minimalist applications and only FOSS applications in my cellphone. However there I recommended you a privative application for compressed files. I’m sorry, since you can use the terminal instead.

Please notice that in order to work properly with the Android command line, you will need a rooted device, Termux runs into a sandbox, which means that everything you do in the terminal is isolated from most of android applications. In order to make files available for the Android applications you have to move your sandboxed files using a root shell, with the su command.

The sandboxed environment is /data/data/com.termux/files/home, it’s too long for remember, so we will create a symbolic link, to do so check the following steps.

  1. Run the whoami command, and write the output in a visible place
  2. Run the su command
  3. Mount the system filesystem as read write mode
    mount -o remount,rw /system
  4. Create the symbolic link
    ln -s /data/data/com.termux/files/home /system/t
  5. execute the following command where USER is the username that you wrote in the first step chown USER /system/t

Finally any file that you want to make available for the android applications you can move it as root

su -c “mv /system/t/file /sdcard”

Working with an existing file

For working with existing files you must allow Termux to access to files in the apps configuration.

How to manage app permissions on Android.

Useful applications

  1. Minimalist text editor there are plenty of text editors for android, but them are too sofisticated, you can simply use termux and nano

2. wget
Wget is a powerful download utility for the POSIX systems

  1. Compress to 7z using the 7za command
  2. Compress and decompress zip files
  3. Convert images to another format using the convert command
  4. Convert videos and music to another format using ffmpeg
  5. Download YouTube videos or only the audio using the youtube-dl script
  6. Download streaming music with streamripper script
  7. Upload files to ftp server using curlftp or curl
  8. Split in parts and join the parts using the split and cat command respectively
  9. Encrypt and decrypt files with gpg

With these examples you will need 10 android applications with lots ads and abusive terms and conditions for getting the same functionality , also you have to deal with the lost of privacy as well as a bad performance.

Finally I also want to recommend you the netstat command that helps to monitor your network conditions, and gnuchess for playing chess.

These bottons respect your privacy