Jump to content

Photo

Guide For Mobile Terminal Commands


  • Please log in to reply
83 replies to this topic

#1
brc0703

brc0703

    The Hat Club

  • Platinum
  • 2,327 Posts
  • Location:California
  • iDevice:iPhone 5S
  • Firmware:7.0.4
  • OS:Windows 7


POPULAR

so going to start out with how to become root and everything in this guide will be as root user unless mentioned otherwise.. everything in ' ' is what to type, dont type the ' ' so if i say 'dpkg' just type dpkg..get it? theres a list of most commands at bottom.. the commands you have depend whats installed in cydia... this is going to be a work in progress guide as im not going to sit here for hours and do it all at once...

ADDED command --help menus for some commands.. get help in terminal by adding --help to most commands.. except apt-get is -h for some reason.. so for help on how to use the commands

'dpkg --help'
'grep --help'
'apt-get -h'




become root user

'su' then will ask for a password and the default password is alpine
'alpine' your not going to see the letters just type it and hit return

then your going to want to change you password so your gona type
'passwd' and then enter the new password you want (you wont see it as you type) and then confirm

apt-get


Usage: apt-get [options] command
apt-get [options] install|remove pkg1 [pkg2 ...]
apt-get [options] source pkg1 [pkg2 ...]

apt-get is a simple command line interface for downloading and
installing packages. The most frequently used commands are update
and install.

Commands:
update - Retrieve new lists of packages
upgrade - Perform an upgrade
install - Install new packages (pkg is libc6 not libc6.deb)
remove - Remove packages
autoremove - Remove automatically all unused packages
purge - Remove packages and config files
source - Download source archives
build-dep - Configure build-dependencies for source packages
dist-upgrade - Distribution upgrade, see apt-get(8)
dselect-upgrade - Follow dselect selections
clean - Erase downloaded archive files
autoclean - Erase old downloaded archive files
check - Verify that there are no broken dependencies

Options:
-h This help text.
-q Loggable output - no progress indicator
-qq No output except for errors
-d Download only - do NOT install or unpack archives
-s No-act. Perform ordering simulation
-y Assume Yes to all queries and do not prompt
-f Attempt to correct a system with broken dependencies in place


EXAMPLES

Spoiler


dpkg

Usage: dpkg [<option> ...] <command>

Commands:
-i|--install <.deb file name> ... | -R|--recursive <directory> ...
--unpack <.deb file name> ... | -R|--recursive <directory> ...
-A|--record-avail <.deb file name> ... | -R|--recursive <directory> ...
--configure <package> ... | -a|--pending
--triggers-only <package> ... | -a|--pending
-r|--remove <package> ... | -a|--pending
-P|--purge <package> ... | -a|--pending
--get-selections [<pattern> ...] Get list of selections to stdout.
--set-selections Set package selections from stdin.
--clear-selections Deselect every non-essential package.
--update-avail <Packages-file> Replace available packages info.
--merge-avail <Packages-file> Merge with info from file.
--clear-avail Erase existing available info.
--forget-old-unavail Forget uninstalled unavailable pkgs.
-s|--status <package> ... Display package status details.
-p|--print-avail <package> ... Display available version details.
-L|--listfiles <package> ... List files `owned' by package(s).
-l|--list [<pattern> ...] List packages concisely.
-S|--search <pattern> ... Find package(s) owning file(s).
-C|--audit Check for broken package(s).
--print-architecture Print dpkg architecture.
--compare-versions <a> <op> <b> Compare version numbers - see below.
--force-help Show help on forcing.
-Dh|--debug=help Show help on debugging.

-h|--help Show this help message.
--version Show the version.
--license|--licence Show the copyright licensing terms.

Use dpkg -b|--build|-c|--contents|-e|--control|-I|--info|-f|--field|
-x|--extract|-X|--vextract|--fsys-tarfile on archives (type dpkg-deb --help).



Spoiler


Settings Permissions


Spoiler


----how to list files, read files, write files-----------

Spoiler


Respring, Reboot---- and some Springboard settings------------------

Spoiler



apt-cache


Spoiler


-----------------------------------------------------------------------------------------------------------------------

'gssc'
display a ton of info about your device..

'locate'
will search your device for what ever you tell it

'locate icon'
will locate and display the path to everything that has icon in the name

'locate icon | grep Themes'
display path to all icons but have to have Themes in the path line... if you ran themes(lower case) it probably woudnt show anything..would use -i to ignoes case diff

'locate icon | grep -i themes'
wouldnt matter if Themes or themes

...thats all for now clicking that stupid sig wasted a ton of time lol.. ill try to add more later..



..well this is taking longer than i expected.. only dont with apt and i wanna quit.. so ill add more later to this.. give suggestions on what commands you want me to explain and if i know ill add it to the guide..


========================================================================

grep filter stdout for lines containing expression

   (only shows that have the word you want )

Spoiler

================================================================

Usage: find [path...] [expression]

default path is the current directory; default expression is -print
expression may consist of: operators, options, tests, and actions:

operators (decreasing precedence; -and is implicit where no others are given):
( EXPR ) ! EXPR -not EXPR EXPR1 -a EXPR2 EXPR1 -and EXPR2
EXPR1 -o EXPR2 EXPR1 -or EXPR2 EXPR1 , EXPR2

positional options (always true): -daystart -follow -regextype

normal options (always true, specified before other expressions):
-depth --help -maxdepth LEVELS -mindepth LEVELS -mount -noleaf
--version -xdev -ignore_readdir_race -noignore_readdir_race

tests (N can be +N or -N or N): -amin N -anewer FILE -atime N -cmin N
-cnewer FILE -ctime N -empty -false -fstype TYPE -gid N -group NAME
-ilname PATTERN -iname PATTERN -inum N -iwholename PATTERN -iregex PATTERN
-links N -lname PATTERN -mmin N -mtime N -name PATTERN -newer FILE
-nouser -nogroup -path PATTERN -perm [+-]MODE -regex PATTERN
-wholename PATTERN -size N[bcwkMG] -true -type [bcdpflsD] -uid N
-used N -user NAME -xtype [bcdpfls]


EXAMPLES

'find / -cmin -30'
find all files in / created in less than 30 min..

'find /private/var/mobile/Documents -amin 50'
find all files in /private/var/mobile/Documents accessed in less than 50 min

PID

heres a script i made up for showing process ids.. ill explain the best i can
lines with that start with # are not read by the script they are only notes for readers..
all except the first #!

Spoiler


[color=red]Loop, How to modify multiple files

going to be using a little bit more complicated terminal commands here..
first your going to figure out what it is you want changed.. we will use a bunch of ROMs that you want to zip individually..
so your going to set a variable to the list of targets.. then the use of 'for line in `targets` do "something" and its going to go line by line performing the task on each one..so this exapmle would be

for line in $(ls /var/mobile/Media/ROMs/GENESIS | grep -v zip)
do
zip "$line".zip "$line"
done


hope that helps a little with understanding how things run together
heres a list of commands on my phone.. your list will be different cuz it depends what you have installed.. and i have somr custom ones in there.. i took most of them out so not to get confused looking for something in cydia



brc0703:~ root#
Display all 631 possibilities? (y or n)
! env mount sha256sum
./ envsubst mount_cd9660 sha384sum
2xrm error mount_devfs sha512sum
7z esac mount_fdesc shc
7za eval mount_hfs shift
: exec mount_kernfs shopt
BTServer exit mount_msdos shred
BTdaemon expand mount_null shuf
BlueTool export mount_procfs sid
BlueToolH4 expr mount_synthfs simulatecrash
DumpBasebandCrash ezrestore mount_union size
PatchBlueTool ezsave msgattrib slattach
SpringBoardAccess-test factor msgcat sleep
[ fairplayd.N88 msgcmp slogin
[[ fairplayd.default msgcomm sms
]] false msgconv sort
abquery fc msgen sorted
abs fdisk msgexec source
ac fg msgfilter split
accessoryd fgrep msgfmt sqlite3
accton fi msggrep ssh
alias file msginit ssh-add
allmyi find msgmerge ssh-agent
aosnotifyd findme msgunfmt ssh-keygen
ap2ipa finger msguniq ssh-keyscan
apmode fmf mso sshd
appSearch fmt mv startupfiletool
appdub fold nano stat
appnum for natd strings
appsearch freemem ncat strip
apt-cache fsck ncurses5-config stty
apt-cdrom fsck_hfs ncursesw5-config su
apt-config fsck_msdos ndiff sudo
apt-extracttemplates fstyp ndp sudoedit
apt-ftparchive fstyp_hfs netstat sum
apt-get fstyp_msdos newfs suspend
apt-key fstyp_ntfs newfs_hfs sw_vers
apt-mark fstyp_udf newfs_msdos sync
apt-sortpkgs fstyp_ufs ngettext syschk
ar ftp nice sysctl
arch function nl syslogd
arm-apple-darwin9-c++ funzip nm tabs
arm-apple-darwin9-g++ g++ nmap tac
arm-apple-darwin9-gcc gawk nmapfe tail
arm-apple-darwin9-gcc-4.2.1 gcc nmedit talk
arp gccbug node tar
as gcov node-waf tee
athief getconf nohup telnet
athief.sh getdeviceinfo nologin test
autopoint getopts notificationWatcher tftp
autossh gettext notify then
awd_ice2 gettext.sh notifyd tic
awk gettextize nping time
backup getty nproc timeout
badge geturl nvram times
badgenum gpg od toe
base64 gpg-zip openURL top
basename gpgsplit openssl touch
bash gpgv otool tput
bashbug gremlind otool64 tr
bg grep pagesize traceroute
bid groups pagestuff traceroute6
bind gssc passwd trap
break gunzip paste trpt
builtin gzexe patchsync true
bunzip2 gzip pathchk truncate
bzcat halt pax tset
bzip2 hash pbcopy tsort
bzip2recover head pbpaste tty
c++ help pcap-config tunefs
c_rehash hexdump pcre-config tweet
caller hidelibconvert pcregrep type
captoinfo history pcretest typeset
case hostid pfctl uicache
cat hostinfo photofix uiduid
cd hostname pid uiopen
chcon id pincrush uishoot
checksyms if ping ulimit
chflags ifconfig ping6 umask
chgrp igawk pinky umount
chmod iis pkglist unalias
chown in play uname
chroot indr plutil uncompress
cksum infocmp pmset unexpand
clear infotocap popd unifdef
clri inquiry powerlog uninstall_zenmap
cmp install pppd uniq
cms install_name_tool pr unlink
codesign_allocate intelliStatusIcons printenv unlzma
comm ioalloccount printf unrar
command ioclasscount ps unset
compgen ioreg ptx until
compiler iostat punchd unxz
complete ip-print pushd unzip
compopt ip6conf pwd unzipsfx
compress ip6fw pwd_mkdb update
continue ipconfig quitTop updatedb
coproc ipcrm quot uptime
cp ipcs quota urlclip
cpp ipfw quotacheck users
csplit itmsSearch quotaon uudecode
ctags jobs racoon uuencode
cunt join racoonctl uuid
curl kill ranlib uuid-config
curl-config killall rcp vdir
cut lang2.2 read vibrate
cycc lang2ez readarray vifs
cyfix last readlink vipw
cymanage launch readonly visudo
daily launchctl reboot vm_stat
date launchd recAudio vsdbutil
db_archive ld recode-sr-latin wait
db_checkpoint ld64 redo_prebinding wc
db_codegen ld_classic renice wget
db_deadlock ldid repquota which
db_dump let reset while
db_hotbackup libtool respring who
db_load link restart whoami
db_printlog lipo restore whois
db_recover ln return write
db_stat lnc rld xargs
db_upgrade local rlogin xgettext
db_verify locale rm xml2-config
dd locate rmdir xmlcatalog
declare lock rnano xmllint
dev_mkdb logger rootme xnmap
deviceinfo login route xz
df logname routed xzcat
diff logout rpcgen xzcmp
diff3 ls rsh xzdec
dir lsvfs rtadvd xzdiff
dircolors lua rtsol xzegrep
dirname luac run-parts xzfgrep
dirs lzcat runcon xzgrep
disown lzcmp safemode xzless
dmesg lzdiff sb xzmore
do lzegrep sbar yes
done lzfgrep sbdidlaunch zcat
dpkg lzgrep sbreload zcmp
dpkg-deb lzless sbsettingsd zdiff
dpkg-name lzma scp zdump
dpkg-query lzmadec script zegrep
dpkg-split lzmainfo scselect zenmap
dpkg-trigger lzmore scutil zfgrep
dpkg-unpack mDNSResponder sdiff zforce
dselect mDNSResponderHelper securekeyvaultd.N88 zgrep
du main.m sed zic
dump makemyring seg_addr_table zip
dumpfs mapfile seg_hack zipcloak
dynamic_pager md segedit zipnote
echo md5sum select zipsplit
edge mediaserverd seq zless
edgrem mesg set zmore
edquota mkdir sftp znew
egrep mkfifo sgchk zprint
elif mkfile sh {
else mknod sha1sum }
enable mktemp sha224sum
brc0703:~ root#

1312011236__brcsigdone.png





 

if this helped hit the + ------------------------->

 


#2
aurrum

aurrum

    Photographer - GrphxDesigner

  • VIP
  • 637 Posts
  • iDevice:iPhone 5S
  • Firmware:7.0.4
  • OS:Windows 8
awesome, thanks for this =D. Always wanted to do more technical stuff with the iPhone :)

#3
noalternative

noalternative
  • VIP
  • 6 Posts
  • Location:Canada
  • iDevice:iPhone 4
  • Firmware:4.3
Thanks for taking the time to make this.. I've seen lots of post referring to MT so its nice to know the basics.

#4
A.J.

A.J.
  • Member
  • 610 Posts
  • Location:US
  • iDevice:iPhone 4S
  • Firmware:5.0.1
Love basic commands for making super simple apps. Like executing (exec) a patch to a game or an /Application/ to call text or open any URL (which also creates multiple shortcuts to apps (; ) etc

#5
brc0703

brc0703

    The Hat Club

  • Platinum
  • 2,327 Posts
  • Location:California
  • iDevice:iPhone 5S
  • Firmware:7.0.4
  • OS:Windows 7
ill work on those next update i do i was already working on this last on and didnt see your post... but just added some new stuff so go see if anythings new to you

holy crap i was working on that for an hour... and just added from dpkg - reboot.. damn no wonder everyone gives me shit for being on this thing that felt like 20 minutes
and i hate the way that crap doesnt line up the same posted as it does when your writing it.. no im not drunk and no im not cross eyed

1312011236__brcsigdone.png





 

if this helped hit the + ------------------------->

 


#6
D3@TH

D3@TH

    BANNED

  • Banned
  • 1,656 Posts
gssc gave me this:
Attached File  IMG_00431.PNG   137.79KB   71 downloadsAttached File  IMG_00441.PNG   137.34KB   47 downloadsAttached File  IMG_00421.PNG   136.07KB   31 downloads

#7
brc0703

brc0703

    The Hat Club

  • Platinum
  • 2,327 Posts
  • Location:California
  • iDevice:iPhone 5S
  • Firmware:7.0.4
  • OS:Windows 7
awesome it works for you too.. what device is that?i touch 3gen?

correct myself 2gen.. thought it said shutterclick -1

dammit you quoted my before i changed it so now i look like i changed it after...

1312011236__brcsigdone.png





 

if this helped hit the + ------------------------->

 


#8
D3@TH

D3@TH

    BANNED

  • Banned
  • 1,656 Posts

awesome it works for you too.. what device is that?i touch 3gen?


iPod 2G

#9
stlwkr

stlwkr
  • VIP
  • 33 Posts
  • Location:United States
  • iDevice:iPhone 5
  • Firmware:7.1.2
  • OS:OS X Yosemite
thanks for the guide, it's great to be able to learn something like this

#10
DrEwTiMe42o

DrEwTiMe42o
  • Member
  • 274 Posts
  • iDevice:iPhone 5
  • Firmware:6.1
  • OS:OS X Lion
Dude thank you so much for posting this, i was looking for something like this to get me started with really understanding terminal but was too scared to just start trying random commands.

Sig.png

~ If  my ramblings helped you at all please hit rep_up.png !!  :)


#11
Chris

Chris

    Bazinga

  • Administrator
  • 4,933 Posts
  • Twitter:@ChrisOSX
  • iDevice:Apple TV
  • OS:OS X Mavericks
Not a big terminal user, but this def helps.... :)

Help insanelyi Out!

Like our repo, forum and everything that's involved? Every feature needs financial assistance to continue it's daily ongoing function. We ask you to Donate or purchase VIP whenever possible. Every little bit helps. Thank You ).gif

Personal donations can be given Here

 


#12
DrEwTiMe42o

DrEwTiMe42o
  • Member
  • 274 Posts
  • iDevice:iPhone 5
  • Firmware:6.1
  • OS:OS X Lion

Not a big terminal user, but this def helps.... :)


I never got into it on mac becaue i only became a mac user about 3 years ago. But got a crap load of experience with that type interface from when MS-DOS was the only way to do anything lol.

I was sitting in my Information systems class and my professor was one of the people who coded for bell labs back in the day. He said when they started building the first main frames they did this one instillation that cost 10,000/month to rent and it had 32k (no not mb, but K!) ram and ran on 2 cylinders about the size of washing machines that housed 5 wheels of disc space totaling 10mb.. Its unreal how far technology has come.

Sorry for the slight tangent just made me think of the old days!

Sig.png

~ If  my ramblings helped you at all please hit rep_up.png !!  :)


#13
brc0703

brc0703

    The Hat Club

  • Platinum
  • 2,327 Posts
  • Location:California
  • iDevice:iPhone 5S
  • Firmware:7.0.4
  • OS:Windows 7
i added a little bit more to this guide so just bringing it up to the recent posts

1312011236__brcsigdone.png





 

if this helped hit the + ------------------------->

 


#14
ColdGlueGun

ColdGlueGun
  • Member
  • 14 Posts
  • Location:Florida
  • iDevice:iPod Touch 4
  • Firmware:4.2.1
wow. i always wanted to learn how to do this. super helpful. thanks a lot!

#15
Tahir

Tahir
  • Member
  • 78 Posts
  • iDevice:iPhone 4S
  • Firmware:5.0.1
To brc0703, If I use 'apt-get autoremove' do i have to put the app name also or just run it the way it is?

#16
brc0703

brc0703

    The Hat Club

  • Platinum
  • 2,327 Posts
  • Location:California
  • iDevice:iPhone 5S
  • Firmware:7.0.4
  • OS:Windows 7

To brc0703, If I use 'apt-get autoremove' do i have to put the app name also or just run it the way it is?


just run 'apt-get autoremove' and it will list the packages to remove and just type 'y' to remove them.. read what it lists though cuz it may want to remove something you still want.. if you dont know what it is then you probably dont need it

1312011236__brcsigdone.png





 

if this helped hit the + ------------------------->

 


#17
Hyshai

Hyshai
  • VIP
  • 330 Posts
  • Location:NJ
  • iDevice:iPhone 4
  • Firmware:5.0.1
This is my fav post!
brc can u add more stuff? please?

#18
brc0703

brc0703

    The Hat Club

  • Platinum
  • 2,327 Posts
  • Location:California
  • iDevice:iPhone 5S
  • Firmware:7.0.4
  • OS:Windows 7
yeah ive learned a bit more since last time i added to this thread... ill add something to it

1312011236__brcsigdone.png





 

if this helped hit the + ------------------------->

 


#19
ShinigamiH4ck3r

ShinigamiH4ck3r
  • Member
  • 55 Posts
  • Location:Buffalo,Ny
  • iDevice:iPod Touch 4
  • Firmware:4.3.3
for you hard core linux users out there, you can use "sudo" you just have to install the package called sudo in cydia. once installed, open ifile, navigate to /etc, open the file sudoers in text viewer,and add the text 'mobile ALL=(ALL) ALL' (without quotes) under 'root ALL=(ALL) ALL'. respring, and enjoy sudo

#20
brc0703

brc0703

    The Hat Club

  • Platinum
  • 2,327 Posts
  • Location:California
  • iDevice:iPhone 5S
  • Firmware:7.0.4
  • OS:Windows 7

for you hard core linux users out there, you can use "sudo" you just have to install the package called sudo in cydia. once installed, open ifile, navigate to /etc, open the file sudoers in text viewer,and add the text 'mobile ALL=(ALL) ALL' (without quotes) under 'root ALL=(ALL) ALL'. respring, and enjoy sudo


isnt that unsafe to do? removes password security then anything can run as root without your knowledge on your device by simply running 'sudo'...

1312011236__brcsigdone.png





 

if this helped hit the + ------------------------->