Just wanted to start a quick FAQ for those users who havn't had a chance to toy around with the Linux console which is what the Android OS is based off of.
1. Commands like 'cat' 'mv' 'rm' are not working, why?
Chances are that these commands currently dont reside on your path, which is common when you start the phone in recovery mode. To remedy this, enter the following in your console
2. How can I copy a file from locationX/app1.apk to locationY?
Depending on if you have busybox installed, and on your path, you may not be able to perform the 'cp' command because it doesn't exist on the system. The android system however, allows binary streaming. To copy from one location to another, perform the following action
3. What exactly is the 'ln -s locationX/app1 locationY/app1' command doing?
Performing an 'ln -s [source] [dest]' is creating something called a symbolic link. This is similar to Windows' "shortcut". For example, if we wanted to create a "shortcut" to /system/bin/mycoolprogram on our sdcard, we can do something like this:
4. How can I list the files in a directory?
Just like in Unix, you can perform the 'ls' command to list out all of the files in a directory. If you would like to list out all files, including those that are hidden (hidden files in unix have a leading period, i.e., .myhiddenfolder) you can add a few flags to the ls command.
The 'chmod' command is actually changing the permissions for the file that you supply. When you perfrom an "ls -a -l" command you will see a large list of files with detail. If you look to the far left of a listing, you will see something similar to the following:
6. I want to backup the files to my sdcard instead of deleting them, how can i do this?
The first thing you want to do, is to create a folder on your sdcard where you can store these apps. I personally like to create a hidden 'appbackup' folder on my sdcard. Lets say now I want to copy and remove the 'HtcWeatherWidget.apk' file, I would do the following:
7. When trying to move a file, I am getting an error that states "mv cannot unlink '[filename]': Operation not permitted" or something similar
The reason that this is happening is because you are trying to move a file from one partition (i.e. /system) to another partition on the same device (i.e. /sdcard). Because the two different partitions have different mounting points, a move cannot be safely performed. The alternative is to perform what is outlined in step 6
8. Are cronjobs available on the android system?
Crontab is available within the android console, however, when trying to modify the cron, or trying to stream the current cron to a file, the following error is thrown
It is currently not known if the incredible nand unlock will help remedy this issue, or if the crontab is currently locked out of the rom
[More to come as I come across some FAQs, hope this helps]
1. Commands like 'cat' 'mv' 'rm' are not working, why?
Chances are that these commands currently dont reside on your path, which is common when you start the phone in recovery mode. To remedy this, enter the following in your console
Note, it is important that the separator is a colon ) not a semicolon (export PATH=/system/bin:$PATH
2. How can I copy a file from locationX/app1.apk to locationY?
Depending on if you have busybox installed, and on your path, you may not be able to perform the 'cp' command because it doesn't exist on the system. The android system however, allows binary streaming. To copy from one location to another, perform the following action
Note, it is important that you include the carat ">" or else the cat command will push the contents of app1 to the console. This will result in the console outputting beeping noises until the phone is disconnected from the debuggercat locationX/app1.apk > locationY/app1.apk
3. What exactly is the 'ln -s locationX/app1 locationY/app1' command doing?
Performing an 'ln -s [source] [dest]' is creating something called a symbolic link. This is similar to Windows' "shortcut". For example, if we wanted to create a "shortcut" to /system/bin/mycoolprogram on our sdcard, we can do something like this:
Now when we execute 'mycoolprogram' from /sdcard, it is actually referencing the applicaiton that is in /system/bin.ln -s /system/bin/mycoolprogram /sdcard/mycoolprogram
4. How can I list the files in a directory?
Just like in Unix, you can perform the 'ls' command to list out all of the files in a directory. If you would like to list out all files, including those that are hidden (hidden files in unix have a leading period, i.e., .myhiddenfolder) you can add a few flags to the ls command.
5. What exactly am I doing when I type 'chmod #### [file]' ?- List files
ls
- List all files
ls -a
- List all files with detail
ls -a -l
The 'chmod' command is actually changing the permissions for the file that you supply. When you perfrom an "ls -a -l" command you will see a large list of files with detail. If you look to the far left of a listing, you will see something similar to the following:
These are the permissions of the file. By executing the chmod you actually modify these permissions which translate to:drwxr-xr-x 4 root
So applying a 'chmod 775 thisfile.txt' would change the permissions tod rwx rwx rwx
dir owner group world
Now the owner and the users of the owning group have read, write, execute access to the file, while the rest of the world can only read and execute the file. The 'd' identifier will signify if an item is a directory. For symbolic links you will see an 'l' instead, and files will have a '-' in its place.-rwxrwxr-x
6. I want to backup the files to my sdcard instead of deleting them, how can i do this?
The first thing you want to do, is to create a folder on your sdcard where you can store these apps. I personally like to create a hidden 'appbackup' folder on my sdcard. Lets say now I want to copy and remove the 'HtcWeatherWidget.apk' file, I would do the following:
What I did above was first, add the bin folder to my path so i can perform a "cat" and "rm" without sourcing its location. I then created a folder in on the sdcard for my apps. I then streamed out the file (a mv wont work here because the /sdcard/ and /system/ are two different mounts, and the file system will complain) to my new folder. Once the streaming is complete, i removed the old file.
- export PATH=/system/bin:$PATH
- mkdir /sdcard/.appbackup
- cat /system/app/HtcWeatherWidget.apk > /sdcard/.appbackup/HtcWeatherWidget.apk
- rm /system/app/HtcWeatherWidget.apk
7. When trying to move a file, I am getting an error that states "mv cannot unlink '[filename]': Operation not permitted" or something similar
The reason that this is happening is because you are trying to move a file from one partition (i.e. /system) to another partition on the same device (i.e. /sdcard). Because the two different partitions have different mounting points, a move cannot be safely performed. The alternative is to perform what is outlined in step 6
8. Are cronjobs available on the android system?
Crontab is available within the android console, however, when trying to modify the cron, or trying to stream the current cron to a file, the following error is thrown
crontab: unknown uid 0: No such file or directory
It is currently not known if the incredible nand unlock will help remedy this issue, or if the crontab is currently locked out of the rom
[More to come as I come across some FAQs, hope this helps]