LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Using Console Debian/Etch/KDE (https://www.linuxquestions.org/questions/linux-newbie-8/using-console-debian-etch-kde-603484/)

r00ster 11-30-2007 07:44 AM

Using Console Debian/Etch/KDE
 
I need a clue.

I'm trying to teach myself how to navigate/explore the KDE filesystem.

In my home/me/ directory, I have some mozilla files I would like to look at in shell. When I "ls -a" in my home directory, the file I want is listed: "morecols-0.3.5.1.xpi".

But when I try to access/expand it, I get:
~$ /morecols-0.3.5.1.xpi
bash: /morecols-0.3.5.1.xpi: No such file or directory
~$ morecols-0.3.5.1.xpi
bash: rooster@royrogers:~$: command not found
~$ morecols-0.3.5.1.xpi

So what's the trick?

pixellany 11-30-2007 08:04 AM

To read a file:

"cat filename" or "more filename" (without the quotes)

To RUN (execute) a file:
If the directory is in $PATH: "filename"
If not, then "/dir/dir/filename" or "./filename" in the same directory**

"/xxxx" tries to execute a file named xxxx at the root (/) level

** "." = this directory---where we are
".." = one directory up

r00ster 11-30-2007 09:01 AM

Quote:

Originally Posted by pixellany (Post 2975560)
To read a file:

"cat filename" or "more filename" (without the quotes)

To RUN (execute) a file:
If the directory is in $PATH: "filename"
If not, then "/dir/dir/filename" or "./filename" in the same directory**

"/xxxx" tries to execute a file named xxxx at the root (/) level

** "." = this directory---where we are
".." = one directory up

pixellany;

~$ cat: /morecols-0.3.5.1.xpi: No such file or directory
bash: cat:: command not found
~$ cat .morecols-0.3.5.1.xpi
cat: .morecols-0.3.5.1.xpi: No such file or directory

~$ more .morecols-0.3.5.1.xpi
.morecols-0.3.5.1.xpi: No such file or directory
~$ more /morecols-0.3.5.1.xpi
/morecols-0.3.5.1.xpi: No such file or directory

I feel not unlike a fool, but you see my problem.

nx5000 11-30-2007 09:30 AM

The syntax is:

PATH/FILENAME
or directly
FILENAME

PATH can be /aa , . , /aa/bb etc..
/aa means directory aa starting from / (see / as the root of a tree). aa is a direct leaf of the root.
/aa/bb means go in the directory aa under / and then again in bb

. is a synonym for the current directory
.. is a synonym for the parent directory ( /aa/.. is equivalent to /)

In case "PATH/" is not present, it is equivalent to
./FILENAME


Quote:

~$ cat: /morecols-0.3.5.1.xpi: No such file or directory
bash: cat:: command not found
~$ cat .morecols-0.3.5.1.xpi
cat: .morecols-0.3.5.1.xpi: No such file or directory
First command: /moreblabla defines a file which has PATH= / , name =moreblabla.
It means the file has to be at the root of the disk but I guess it's in your directory.
Second command
You forgot the / : .moreblabl is a file in the current directory with name .moreblabla. unfortunatly your file is moreblabla (without the dot)

So it's either
cat ./moreblabla
or
cat moreblabla


Your shell will execute the first argument. Above it was "cat" which displays the second argument (moreblabla)
If you want to execute a script, you then have to pass it as first argument.
./moreblabla
BUT in your case, morecols-0.3.5.1.xpi is not possible to be executed from command line, it's a "plugin" for firefox: the suffix is "xpi".


All times are GMT -5. The time now is 10:25 AM.