Using the terminal
Posted 22 June 2004 - 03:16 PM
I don't have much experience using the command line, I was born too late for that. I've briefly used DOS prompt and Cygwin. I stumbled my way round the Terminal in my first few days using Red Hat.
Since then I have looked up tutorials and understand the operation of scripts and how to use them as well as many commands that can be used in the shell.
What is most important for me is accessing files fast. I can do this using the cd, dir and ls commands. The problem is I don't know how to open a non-ASCII file from the terminal. Is there any way to make the Terminal open a file with its default viewer/editor? I know you could do this in XP but the point is I don't want to use XP anymore.
Any other terminal tips (other than use of the middle-mouse button) would be appreciated. I also would like to know how the change the focus policy (mentioned here:http://linuxcommand.org/lts0010.php#xterm in GNOME.
Posted 22 June 2004 - 03:59 PM
If you need to open, read or edit files from the command line, try vi. for instance, as root go..
vi /etc/fstab [enter]
to close vi go press escape, then go:
: x [enter]
without a space between : and x.
Be careful not to save a file if you accidently edit it wrongly.
[Edited by Dapper Dan on 2004-06-22 09:34:56]
Posted 22 June 2004 - 04:12 PM
Thanks for the reply. I've already seen that site with all those commands. Vi is a text editor those so will only open ASCII files.
In DOS prompt under XP, I could type "dir <ENTER>" find x.jpg, simply type x.jpg in the terminal and press enter. x.jpg would then open in XP with the program associated to that file type.
For example, can I open x.jpg with the default viewer directly from the terminal without giving the path to x.jpg as an argument to some command?
Posted 22 June 2004 - 04:39 PM
gimp x.jpg [enter]
and it will open it. There are other viewers as well. When I was using Mandrake, I especially liked electric eyes for quick viewing of picture files. I don't think we have that. Gnome viewer is pretty good too..
Posted 22 June 2004 - 07:39 PM
We still aren't on the same wavelength I am afraid. But I think the answer to my question is "no".
If I just type x.jpg in the Terminal nothing will happen unless I specify the program I want to open it with (eg type gimp beforehand). Thats fine (other than the fact I would prefer not to type gimp every single time, especially if I want to open many picture files). So how about this?
I am using a program called Blender http://www.blender3d.com. I have downloaded a linux version which I cannot call from the terminal unless I am in the directory where Blender is installed and I type "./blender". This means if I have a .blend file in any other directory, I can't open it from the Terminal.
Nautilus on the other hand allows me to double click any .blend file in any folder to open it in Blender as I have associated ".blend" files with "Blender". I was wondering if you could use this association between ".blend" and "Blender" in the Terminal so if I type "x.blend" in the terminal and press enter, the file opens.
In nautilus you simply double click a file to open it with a default application. In the Terminal you have to specify the program to open it with. Is this correct?
If this is true, from what I have read, I need to set the path to the blender executable so it becomes a recognisable command. Can you help me do this? Maybe a shell script could be made to recognise the file type and send the appropriate command to the terminal?
I realise I may not have stated my question clearly enough :x
Posted 24 June 2004 - 06:03 AM
If you want to run a file with blender, you can symbolically link it to you /usr/bin directory, and that should work.
I untarred it, and placed blender-2.33a-linux-glibc2.2.5-i386 into /usr/share.
I then sybolically linked it by doing as root:
ln -s /usr/share/blender-2.33a-linux-glibc2.2.5-i386/blender /usr/bin/blender [enter]
I now can call it by just doing:
from a console, and it opens. You should now be able to open your files by just preceding it with blender like:
blender x.jpg [enter]
I hope this helps...
Posted 24 June 2004 - 09:38 PM
Blender does everything (though sometimes in a round about way). You will need python installed though: http://bane.servebeer.com/programming/blender/#3DS
Nice to see you are interested.
P.S> Did you see this yet?: http://www.elysiun.com/forum/viewtopic.php?t=26673 :x
Actually there is so much good work being done with Blender it may be unfair to single this one out. Problem is it is so damn good.