[Tutorial] Terminal Comands.

Discussion in 'iPod touch' started by Ezra, Mar 20, 2008.

  1. Ezra

    Ezra Well-Known Member

    Joined:
    Feb 23, 2008
    Messages:
    1,122
    Likes Received:
    41
    Device:
    iPhone
    Most of you who are not amazing with UNIX, would probably like to know some simple yet VERY useful commands that you can type into Term-vt100 (or puTTy).

    Here are some useful commands:

    Fix Application crashing! (chmod):
    Code:
    chmod +x /Applications/AppName.app/AppName
    Application Launch (You can use this to launch hidden apps):
    Code:
    cd /Applications
     cd AppName.app
     ./AppName
    Resping (Restart Spingboard):
    Code:
    launchctl stop com.apple.SpringBoard
    Zip Files (You must install the Zipper via the installer):
    Code:
    zip -r NameOfZip FolderToAdd
    Find ANY app/file/etc. (very useful if you don't know the location a file is being stored!)
    Code:
    find /|grep -i *NAME*
    Reboot:
    Code:
    Reboot
    Fixes many problems on 1.1.3/4:
    Code:
    chown -hR mobile /var/mobile
    Killing (stopping) a process:
    Code:
    kill -9 [pid]
    See live process data:
    Code:
    top
    See current user (Usually Root):
    Code:
    whoami
    See current directory:
    Code:
    pwd
    Change user:
    Code:
    login [username]
    An Applications symlink, so you don't need BossTool:
    Code:
    mkdir /private/var/Applications
    cp -Rp /Applications/* /private/var/Applications
    rm -rf /Applications && ln -s /private/var/Applications/ /Applications
    reboot
    Show current disk space usage:
    Code:
    df -h
    [COLOR="Red"]
    -If typed in correctly, it should look like this-
    [/COLOR]
    Filesystem     Size   Used  Avail Capacity  Mounted on
    /dev/disk0s1   300M   162M   135M    54%    /
    devfs           15K    15K     0B   100%    /dev
    /dev/disk0s2    15G   202M    15G     1%    /private/var
    Setting permissions (Replace 777 with 755, or whatever you want)
    Code:
    /bin/chmod -R 777 /Applications/AppName.app/AppName
    Please reply with other useful ones a may of left out!

    Thanks,
    Ezra

    PS: Can this be a sticky?
    6 people like this.
  2. amras16

    amras16 New Member

    Joined:
    Mar 13, 2008
    Messages:
    51
    Likes Received:
    1
    thanks just what i was looking for
  3. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    Amazing thanks i was looking for these. Now i can see what is repos are slowing installer down by running it and watching the output, credit to SkylarEC for that one.
    +Rep, with Stephen.4 attached to comment.
  4. Ezra

    Ezra Well-Known Member

    Joined:
    Feb 23, 2008
    Messages:
    1,122
    Likes Received:
    41
    Device:
    iPhone
    No Problem! Hundreds of people are looking for this

    Please Register or Log in to view images



    Ezra
  5. Axis

    Axis Super Moderator Staff Member

    Joined:
    Dec 2, 2007
    Messages:
    6,288
    Likes Received:
    133
    Device:
    iPhone 4S (White)
    This stuff probably isn't anything new to some of us, but this is a great compilation and reference source. Great job!
  6. Ezra

    Ezra Well-Known Member

    Joined:
    Feb 23, 2008
    Messages:
    1,122
    Likes Received:
    41
    Device:
    iPhone
    Thanks! Please feel free to submit your own, and I will update it!
  7. jfb392

    jfb392 New Member

    Joined:
    Oct 20, 2007
    Messages:
    2,512
    Likes Received:
    21
    Device:
    iPod touch
    You may want to add the following:

    Set UID (useful for applications that need to be run as root, not mobile):
    chmod +s /Applications/Name.app/Application

    Fixes many problems on 1.1.3/4:
    chown -hR mobile /var/mobile/

    See processes:
    ps -ax

    Limit processes to applications:
    ps -ax | grep Applications

    You could even limit this to one application, just replace Applications with the name.

    Killing (stopping) a process:
    kill -9 [pid]

    The pid can be found when running ps -ax, it is to the left of the process.

    See live process data:
    top

    See current user:
    whoami

    See current directory:
    pwd

    List directory:
    ls

    For owner and permission details:
    ls -la

    View text files (crude, but works):
    cat file

    Copy file:
    cp file newfile

    Copy directories recursively (permissions intact):
    cp -Rp directory/* newdirectory/

    Move files:
    mv file directory

    Rename files:
    mv oldfile newfile

    Change user:
    login [username]

    Fake user mobile when logged in as root (logging in as mobile fails, I think):
    su mobile

    Full reboot:
    reboot

    Misc:
    ~ resolves to your home directory (/var/root/ when user root, /var/mobile/ when user mobile)
    When using cd, you can go up a directory by changing to the .. directory.
    Directories are resolved locally, unless there is a beginning /.
    For example, cd Applications =/= cd /Applications.
    You can link chains of commands together with && and run commands while others are running with |.
    For example, if you wanted to change to a directory and list it, you could do:
    cd directory && ls
    To use the pipe, you could do a simple echo:
    echo holla | cat > test

    You've echoed holla to the file test, and to prove it, you can run cat.

    Also, an Applications symlink, so you don't need BossTool:
    mkdir /private/var/Applications
    cp -Rp /Applications/* /private/var/Applications
    rm -rf /Applications && ln -s /private/var/Applications/ /Applications
    reboot
    1 person likes this.
  8. Axis

    Axis Super Moderator Staff Member

    Joined:
    Dec 2, 2007
    Messages:
    6,288
    Likes Received:
    133
    Device:
    iPhone 4S (White)
    Also, you can launch an app this way.

    i.e.

    EDIT:

    -does what you think it does...
  9. Ezra

    Ezra Well-Known Member

    Joined:
    Feb 23, 2008
    Messages:
    1,122
    Likes Received:
    41
    Device:
    iPhone
    Thank you!

    I have added the most useful ones!

    if anyone else has any, please post!

    Thanks,
    Ezra
  10. Ezra

    Ezra Well-Known Member

    Joined:
    Feb 23, 2008
    Messages:
    1,122
    Likes Received:
    41
    Device:
    iPhone
    MODs. Do you think this could be a sticky?

    Thank,
    Ezra

Share This Page