Opening a file location in termux | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Opening a file location in termux

I want to open a file named learning log But termux takes the space in between learning and log as something else. So how do I open this file without changing the name ?

19th Oct 2021, 4:35 PM
Richard
Richard - avatar
14 Answers
+ 3
Plus, what do you mean by 'open'? Do you mean print to standard output so you can view the text? Cause you can use cat. Go to the directory where the file is located and enter: cat <filename> come on Coding Cat get on vim! Its not bad after a while. Nano is pretty cool though
19th Oct 2021, 5:47 PM
Slick
Slick - avatar
+ 2
I'm sure it must, I usually just go for vim. Its the same across platforms, but dang it's usually preinstalled on most distros. You also might want to look into making a ".vimrc" file if you like customization. Line numbers, color, indent lengths, etc.
19th Oct 2021, 6:12 PM
Slick
Slick - avatar
+ 1
[ESCAPE] [ESCAPE] [ESCAPE] (just to be sure) *close options :q! "close now! don't save" :x "save & close" only two i really ever use
19th Oct 2021, 6:01 PM
Slick
Slick - avatar
+ 1
Right, because you are trying to run a python file Im guessing? If so, the syntax is: python <filename> [options, ...] Plus you can't change directory INTO a file. It doesn't contain any other files
19th Oct 2021, 6:41 PM
Slick
Slick - avatar
+ 1
Then type the first few letters of the file and press TAB. It'll autocomplete the filename so you know how to enter it
19th Oct 2021, 6:47 PM
Slick
Slick - avatar
+ 1
You can open files name containing spaces, by adding backslash. cat <filename> For your case: cat learning\ log
20th Oct 2021, 4:56 AM
Z4N
Z4N - avatar
+ 1
Slick I figured it out internal storage on Android is this location: /storage/emulated/0 So I changed the filename to learning_log and then did this cd /storage/emulated/0 cd learning_log And it worked
20th Oct 2021, 10:18 AM
Richard
Richard - avatar
+ 1
touch filename :- to create an empty file cat filename:- accessing or reading that file
21st Oct 2021, 4:16 AM
Vishal Pandey
0
Slick open with command(cd)
19th Oct 2021, 6:25 PM
Richard
Richard - avatar
0
cd or "change directory" just moves you to another location in the filesysystem. when you are in the directory the file you want to read is located, use cat
19th Oct 2021, 6:27 PM
Slick
Slick - avatar
0
Slick ya I am working on Django project. I want to do this : cd learning log manage.py runserver But It is not working
19th Oct 2021, 6:34 PM
Richard
Richard - avatar
0
if you didn't write manage.py yourself, i'd try: python manage.py runserver and try not to put spaces in your filenames
19th Oct 2021, 6:35 PM
Slick
Slick - avatar
0
Slick the cd part says no such file directory. Yet on pydroid it is working
19th Oct 2021, 6:39 PM
Richard
Richard - avatar
0
Django project is not python file it's a folder Slick
19th Oct 2021, 6:45 PM
Richard
Richard - avatar