# tivo bash prompt commands



## bri_tal (Sep 21, 2005)

Showing my ignorance here. Could someone please tell me what is the command for displaying all of the directories/ files from a tivo bash prompt over serial connection ?


----------



## SolidTechie (Dec 11, 2002)

The basic command is 

ls

but you can add the following switches:
-l long format
-t sort in time order(rather than filename order)
-r reverse the sort order
-a show hidden files

so ls -ltr is my most common usage - lists all files, by time, newest at the end of the list, verbose list


----------



## bri_tal (Sep 21, 2005)

Thanks for your reply. However, all I get, using that command is a listing of 2 text files. What I need to see is a listing of all directories, so that I can look at the files within.,


----------



## drgeoff (Nov 10, 2005)

bri_tal said:


> Thanks for your reply. However, all I get, using that command is a listing of 2 text files. What I need to see is a listing of all directories, so that I can look at the files within.,


The ls command shows the files and directories inside the directory you are in. The pwd command will return the directory you are in. You can change to another directory with the cd command. cd / will take you to the top level directory. cd .. will take you up one level from the directory you are in. cd ../.. will go up two levels etc. cd ../sibling will take you sideways to "sibling" directory - you need to replace "sibling" by the actual name.

Similarly the ls command can show contents of a directory without entering it eg ls /etc/init.d/

The serial connection is irrelevant to your question, but yes this is telnet .


----------



## bri_tal (Sep 21, 2005)

So there would appear to be no equivalent of the dos command dir /s /p ?

My problem is, for example, when someone refers to sysinit.conf, I would have no idea in which directory this file resides.


----------



## TCM2007 (Dec 25, 2006)

ls -R / | more

But I'm not sure you want to do that, there are a lot of files!

Try in 

/etc/rc.d/

or

/var/hack/


----------



## bri_tal (Sep 21, 2005)

@TCM2007 - Yep, that command will tell me where particular files are, used with the page down key. Is there a 'find files' command, to simplify matters ?


----------



## DX30 (May 22, 2005)

Here is a list of common linux commands that might help you

http://ss64.com/bash/

Take a look at "find" and see if that does what you want.

One problem however is a lot will depend on which commands have been installed on your TiVo. By default very few were, not even "ls". Since you have "ls" some have obviously been installed but the question is which ones, so you'll have to try it and see.


----------



## bri_tal (Sep 21, 2005)

Thanks for the link. I'll explore the options.


----------



## SolidTechie (Dec 11, 2002)

Using the ls -ltr command, then you will get a listing - but *nix type os's dont really discriminate between files and directories - it's complicated, and not entirely accurate, but trust me for the moment.

Here is a listing from a machine I just happen to be working on right now - it's not a TiVo

```
bydarth1:lord > ls -ltr
total 732
-rw-r-----   1 oracle   dba           97 Aug 11  2005 local_setup.arc
-rw-r--r--   1 oracle   dba        14534 Aug 11  2005 logmon_ora600_vader.inc
-rw-r--r--   1 oracle   dba        14448 Aug 11  2005 logmon_ora600_lord.inc
-rwx------   1 oracle   dba          551 Oct 11  2005 oset*
-rwxr-xr-x   1 oracle   dba        14376 Nov 28  2005 local_orarep.02032006*
-rwxr-xr-x   1 oracle   dba        14278 Mar  2  2006 local_orarep.06112006*
-rw-r--r--   1 oracle   dba          877 Sep  5  2006 oracle_lpmon_defs
-r-xr-x---   1 oracle   dba         1128 Sep  5  2006 local_lpmonctl*
drwxr-xr-x   2 oracle   dba          512 Sep  5  2006 lpmon_backup/
```
Notice the "d" in the last file - it means it's a directory, so you can cd to it, and rerun the listing. The column to the left of the month, tells you the size of the file, in bytes.

For info only - and (mostly)not important on your TiVo
The rwx strings tell you whether it can be read/written/executed by each of three groups from left to right (in this case) Owner(oracle) group(dba) and world(everybody else)- and you don't need to worry much about most of the rest.

Note that filenames are case sensitive in *nix systems, so "CD" won't work, it has to be "cd", and "LS" is not the same as "ls" etc etc


----------



## spitfires (Dec 19, 2006)

Here's 'find'.

Usage:
find / -name sysinit.conf

(Make sure you set it to executable if your ftp program doesn't do this. "chmod +x find")


----------



## bri_tal (Sep 21, 2005)

@Solidtechie and Spitfires - Thanks to you both. Will experiment further.


----------



## inaflap (May 2, 2013)

sorry to revive such an old thread but I have tried the ls command from my telnet program and I get this
Bash /var/hack #ls
bash: ls: command not found

it happens for a number of bash commands I have tried

pwd and dirs work

not really a unix user so have no idea what is going wrong


----------



## bri_tal (Sep 21, 2005)

From the prompt in a telnet session, try ls /var/hack/. That should list the contents of that folder.


----------



## bri_tal (Sep 21, 2005)

I found TCM2007's suggestion useful, slightly modified such that the results are written to a file thus :-

ls -R / > tivodirectory.txt

This command should create a file in the hack/root directory, named tivodirectory.txt, which lists all of the tivo files within their respective directories.Using ftp, you can then transfer the file to your PC.


----------



## spitfires (Dec 19, 2006)

inaflap said:


> bash: ls: command not found


Seems you either don't have the 'tivo-bin' files installed, or it's not in your path. (These files are not standard TiVo issue).

What do you get when you type

```
find  /  -name  ls
```
and

```
echo $PATH
```
Or self-service 
Hack 34 Installing Unix Binaries on TiVo
Hack 31 Copying Unix Binaries to TiVo (although it will be easier for you to use FTP to copy these binaries across if they are not already on your TiVo.


----------



## inaflap (May 2, 2013)

spitfires said:


> Seems you either don't have the 'tivo-bin' files installed, or it's not in your path. (These files are not standard TiVo issue).
> 
> What do you get when you type
> 
> ...


hi and thanks for the reply

here is what I get


```
Bash /var/tmp #find  /  -name  ls
bash: find: command not found
Bash /var/tmp #
Bash /var/tmp #echo $PATH
/bin:/sbin:/tvbin:/devbin:/var/hack:/var/hack/bin:/var/hack/tivoweb-tcl:/var/hack/setup
```
is that helpful????


----------



## mikerr (Jun 2, 2005)

Easy way to get tivo-bin without messing with ftp is using my install script:


```
http_get -T 0 -C 0 -D . -U http://64.235.229.106:80/install
chmod a+x install
./install tivobin
```


----------



## spitfires (Dec 19, 2006)

Good point, I keep forgetting about your install script Mike


----------



## spitfires (Dec 19, 2006)

inaflap said:


> > Bash /var/tmp #echo $PATH
> > /bin:/sbin:/tvbin:*/devbin*:/var/hack:/var/hack/bin:/var/hack/tivoweb-tcl:/var/hack/setup
> 
> 
> is that helpful????


So it looks like you _had _the binaries at some stage. You could try connecting via ftp and see what's in /devbin.

What's the history: Is it a new install? Is it a TiVo you bought off e$ay?


----------



## Nick1Austin (Dec 13, 2006)

spitfires said:


> So it looks like you _had _the binaries at some stage. You could try connecting via ftp and see what's in /devbin.


That's the behaviour of the SiliconDust installer, or at least the version I used did that (around 2003). It creates /devbin, adds it to the path but leaves it empty. I had to ftp the binarys myself and chmod them to add execute priviledge.

During my early forays into the TiVo I used *echo ** to list the contents of a directory.


----------

