Reply
Thread Tools
nicholes's Avatar
Posts: 1,103 | Thanked: 368 times | Joined on Oct 2010 @ india, indore
#1
hello i m new here also in n900 i want to rename a file using x terminal.i did "cd camera" then enter succeeed then i type"mv filename filename2" then enter.it says cannot rename (filename) : no such file or directory" m i doing something wrong?if yes then tell me step by step plz also plz answer me this is my first thread!!!!
 
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#2
*Sigh*

First off, there is no "camera" folder that I know of. There is a "DCIM" folder, which, in the normal file manager, shows up as "Camera" - but point is it's still called DCIM. If you just open X-Term and type "cd camera", you will get an error.

-sh: cd: can't cd to camera

So IF you did "cd camera" and "succeeed", you were either in some folder that shouldn't exist, in a folder you made yourself (makes sense), or you typed a different command than literally "cd camera" - in which case don't put it in quotes, because that's misleading.

Anyway, when you open x-term, you start in the ~ directory. This is actually a symbol used in most Unix-derivative OS shells for /home/user/ - what you see in your file manager is one folder above that: /home/user/MyDocs . Now, I'm assuming, based on what little information you left, that you want to go to the folder where the camera saves pictures. So when you open X-Term, type "cd MyDocs/DCIM". Then do the mv [filename1] [filename2] command. If the file you're using is a .jpg, then make sure to include that at the end of the name, both the original and the renamed file.

Honestly, though, I would recommend you go download a few of the other available file managers and test those out. They let you go through more of the file system without having to go through X-Term. If you really want to learn the X-Term way go for it, but you'll probably find the actual GUI program way much easier.
 

The Following 2 Users Say Thank You to Mentalist Traceur For This Useful Post:
Posts: 346 | Thanked: 271 times | Joined on Jan 2010
#3
Are you sure that camera is the right folder ?
Photos are stored in /home/user/MyDocs/DCIM
so it is accessible by doing cd MyDocs/DCIM
For avoid error and save time, you can do Tab or ctrl-i for autocomplete in Terminal, note also that for use file or directory with some special characters (such as (); or even space), you need to add a backslash (\) before the special characters
"My photo" will become in terminal "My\ photo" in terminal (don't forget maj too, unix is case-sensitive)
 
Posts: 50 | Thanked: 57 times | Joined on Dec 2009
#4
Well, you're using the right commands ("cd" to go to the folder, and "mv filename1 filename2" to rename/move) so that's not the problem.

1) Are you sure you are in the right folder? So you opened xterminal, typed cd camera, and it didn't gave you any errors? I'm asking because "/home/user/camera" isn't an original folder (normally). So normally xterm would show an error (can't cd to camera), and you would still be in /home/user

/home/user/MyDocs/DCIM is the folder where pictures taken by your n900 camera are stored by default and
/home/user/MyDocs/.images/ is the other default image folder


2) If you are 100% sure you were in the right folder; are you sure you didn't make a typo? I know it's a pretty stupid question but those things can happen to anyone. Make sure you type the full filename, i mean: "picture256.jpg" instead of just "picture256" for example.
 
Posts: 12 | Thanked: 18 times | Joined on Sep 2010
#5
Originally Posted by nicholes View Post
hello i m new here also in n900 i want to rename a file using x terminal.i did "cd camera" then enter succeeed then i type"mv filename filename2" then enter.it says cannot rename (filename) : no such file or directory" m i doing something wrong?if yes then tell me step by step plz also plz answer me this is my first thread!!!!
Agree with all of the above replies. However, there is a definitive way to see whether filename1 exists: at the point when you are ready to type "mv filename1 filename2" (i.e. after you have done "cd camera"), then instead of typing that "mv" command, type this:

ls filename1

(Of course, you substitute filename1 with the actual filename, like abc123.jpg or whatever.)

This will list all files that are called filename1 ("ls" is short for "list"). If the response is a line that contains filename1, then filename1 exists. If there is no response or it says there's an error, then filename1 does not exist.

If it does exist, then something weird is going on: you should be able to use the "mv" command to rename the file. In that case, type this command:

ls -l filename1

watch the spacing and letters: that's lower-case L, then s, then space, then hyphen (or minus), then lower-case L, then space, then the filename.

Then tell us the result of the "ls -l filename" command.

On the other hand, if the file does not exist, that's why you can't rename it. Type this command:

pwd

This will tell us what directory you are currently in ("print working directory"). Then tell us what it says.
 

The Following User Says Thank You to C.Whiteham For This Useful Post:
nicholes's Avatar
Posts: 1,103 | Thanked: 368 times | Joined on Oct 2010 @ india, indore
#6
i m not sure if the camera is the right folder but when i write "cd camera"and enter it jumps me up in the folderand looks loke " ~ / camera $ "and when i tried to go /home it says "permission denied"
 
cfh11's Avatar
Posts: 1,062 | Thanked: 961 times | Joined on May 2010 @ Boston, MA
#7
To access /home you need rootsh installed. Without rootsh, Xterm automatically opens in /home/user/ and will not allow access below this level.

Regarding your original issue, it's as simple as this: Either you are not in the right folder or you are entering the file name wrong. Make sure you use Tab in Xterm to autocomplete filenames and directory names.

Btw, is there a reason you are not just using file manager to rename the file?
__________________
Want to browse streamlined versions of websites automatically when in 2g? Vote for this brainstorm.

Sick of your cell signal not reconnecting after coming out of a bad signal area? Vote for this bug.
 
nicholes's Avatar
Posts: 1,103 | Thanked: 368 times | Joined on Oct 2010 @ india, indore
#8
Thanks for all thoes replying very quick.moemo cummunity is really active ..about renaming a file i think there is some problem with my x terminal let me tell u in detial...i opend xterminal "~ $" is shown (i do not know in what folder i m )then i type "cd home" ~/home $" is shown then(i put the .jpg file in home folder to renamefor testing ) then i type "mv filename.jpg newfilename.jpg" and enter ,it says "~sh: filename.jpg: not found" i also tried to type without ".jpg" i typed"mv filename newfilename.jpg"then it says "mv: cannot rename 'filename': :no such file or directory" also cannot rename the file using (inbuilt)file manager i typed the name and hit save but the name remains the same!(but in diffrent filemanager it has changed!) now i m thinking to reflash the memory or i should take to nokia care ?it is under warrnty yet
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#9
xterm prints the name of the current working directory and a "$"
in front of the command line. For example:

"/home $"
or
"/usr/share $"
Your users HOME directory is /home/user and "~" is an abbreviations for this.
Therefore
"~ $" means
"/home/user $"

nicolai
 
Posts: 166 | Thanked: 30 times | Joined on Apr 2010 @ Halifax, UK
#10
how did you put the file in the home directory? i think you're getting mixed up somewhere if you open up xtern you can't just cd to home you have to type 'cd ..' to go to home

if you open up your gallery, find the image you want to rename, hold your finger on it and select details, then scroll down and make a note of its name - it will be numbers/date by default
open xterm and run

cd MyDocs/DCIM
mv filename newfilename

if you you get an error you've either typed the name wrong or its not there
run

ls

to list all the files that are there
 
Reply


 
Forum Jump


All times are GMT. The time now is 15:27.