Page 1 of 2 12 LastLast
Results 1 to 10 of 12
Discuss [INFO] Various Mac/Unix Terminal Commands at the Genuine Mac Support - Hackint0sh.org; Also other info. ***BEGIN TERMINAL INFO*** First off, Terminal is Mac OS X's version of ...
  1. #1
    Newbie Array

    Join Date
    Apr 2006
    Posts
    6
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default [INFO] Various Mac/Unix Terminal Commands

    Also other info.

    ***BEGIN TERMINAL INFO***
    First off, Terminal is Mac OS X's version of Konsole from Linux, or Command Prompt from Windoze. It is located in /Applications/Utilities, down at the bottom. To open it, double click it.

    When it opens and has a rectangular block sitting there, it is ready for your command(s).

    Info about Root
    On UNIX based systems such as Mac OS X or Linux, root is the main user for the computer, which has access to *everything*. In other words, this is the System Administrator account, which lets you do maintenance, etc.

    Login as Root
    sudo -s

    After typing that, it will prompt you for your user password, assuming you're on an administrator account. Once you are accepted, you can do the rest of these commands.

    OR:
    su, which asks for the root password. If you don't have the root user enabled, follow the directions below. NOTE: Enabling the root user can be dangerous.

    Again, after typing that, it will ask for the root password.

    Change root password
    If you don't like your root password, use:
    sudo passwd root
    Then type in your old root password, then give it a new password. If you had no root password before, it will simply ask you to enter a new password.

    WARNING: TERMINAL WILL *NOT* PROMPT YOU FOR CONFIRMATION OF DELETIONS, RENAMES, ETC.
    ***NOTE: sudo CAN BE LINKED WITH ALL OF THESE COMMANDS, IF YOU DO NOT WISH TO LOGIN AS ROOT; THIS WILL LET YOU ACT AS THE SUPER USER FOR THE ONE COMMAND.***

    Change directories

    To move around in the various directories, use cd.
    Example: cd /applications
    That will move you into the applications folder.
    Typing cd with no argument will return you to the directory you were in before.

    To change to a directory with spaces in the name, surround the directory name in quotes.
    Example: cd /Applications/"XChat Aqua"
    That will move you into a folder called XChat Aqua in the applications folder.

    Move to other volumes/disks/partitions

    To move to different volumes/disks/partitions, use cd again.
    Example: cd /volumes/Mac
    That will move you into the root (/) directory of the volume named Mac.

    You can also change to a volume with spaces, much like the last hint.
    Example: cd /volumes/"Mac OS X"


    Remove a file from your Mac

    This will remove a file from the same directory you are in:
    rm <filename>
    Example: rm something.txt

    You can specify a path to a file to delete, if it is in a different folder.
    rm /path/to/something
    Example: rm /Applications/Candybar.app
    This will remove the application Candybar from your applications folder:

    This will remove a directory/folder on your Mac:
    rm -d <folder>
    Example: rm -d delete_me
    (Say you had a folder called delete_me in /, your start disk's main folder)

    Note: You can specify a path for this too, like the previous rm commands.

    Copy a file

    To copy a file, use:
    cp <filename> <name_of_copy>
    Example: cp something.txt somethingelse.txt
    This will make a duplicate of something.txt and name it somethingelse.txt

    Move a file
    To move a file, use:
    mv <filename> <destination>
    Example: something.txt /Applications
    This will move something.txt to the Applications folder.

    Create a folder
    If you want to make a folder:
    mkdir <name_of_folder>
    Example: mkdir directory
    Will make a folder called directory in the current folder you are in.

    NOTE: You can also specify a path if you want to put the folder somewhere specific.
    Example: mkdir /Applications/directory

    Repair Permissions of a folder
    If you've been naughty and messed with the System/Library/Extensions folder at all, hysterical.gif , you can repair the owner and permissions of the folder by doing:

    chmod -R 755 <path>
    chown root:wheel <path>

    chmod -R 755 /System/Library/Extensions
    chown -R root:wheel /System/Library/Extensions

    NOTE: This can also be done(to a lesser extent) through Disk Utility in /Applications/Utilities. Open Disk Utility and select your Mac Volume, then click Repair Disk Permissions.

    Text editing
    If you want to edit various files in the Terminal:
    nano <filename>
    vi <filename>
    emacs <filename>

    Whichever you use is up to you. They all are text editors. NOTE: I have only used nano, so I can't really help people with vi or emacs.

    You can also call TextEdit from the Terminal:

    sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit

    You can add the path of the file you want to edit to the end of the command line and it will open with TextEdit or just browse for it in TextEdit.

    ***END TERMINAL INFO***

    ***BEGIN GENERAL MAC OS X INFO***

    Run a Universal program in Rosetta
    If you have a program that seems to be acting funny, and it's Universal, just right click(CTRL+Click for one button mice) the program, then choose Get Info, then when it pops up, look for a check box that says "Run in Rosetta". This will make the program run under Rosetta, Mac's PowerPC emulator, which allows for PowerPC apps to run, or Universal apps to run under PowerPC instructions.
    N.B.: Not all programs have a "Run in Rosetta" option, so don't freak out if there's no option for it.

    NOTE: ALL THE FOLLOWING CAN ALSO BE DONE ON HACKINTOSHES BY PRESSING F8 AT STARTUP WHERE IT WILL GIVE YOU A BOOT COMMANDLINE, WHERE YOU CAN INPUT YOUR OPTIONS THERE, SO THAT YOU CAN HAVE THOSE OPTIONS ON THAT BOOT ONLY.

    Boot in verbatim mode to see errors/info about your mac
    If you seem to be having weird errors with Mac and can't figure out why, try booting in verbatim mode, which tells you word for word what Mac is doing as it is starting up. In Terminal, navigate to /Library/Preferences/SystemConfiguration. Then sudo nano com.apple.boot.plist . Then below where it reads, "<key>Kernel Flags</key>", where it says <string></string>, add -v between the two string angle brackets so it looks like this:
    <string> -v </string>

    After this, press CTRL+O to save the file and reboot. To remove verbatim mode, simply follow the steps again and just remove -v from the string line.

    Force a screen resolution on startup
    If you want to force Mac OS X to start with a certain screen resolution: follow the steps from the previous information, however, on the string line, add:
    "Graphics Mode"="1024x768x32@60"
    Where 1024x768 is the resolution you want, x32 is the color depth you want, and if you have VESA 3.0 graphics, @60 the color depth you want. If done correctly, it will look like this:
    <string> "Graphics Mode"="1024x768x32@60" </string>

    Startup in Safe Mode
    If you want to boot up in Safe Mode if something is giving you problems, simply add -x to the kernel flags:
    <string> -x </string>
    Just follow previous instructions.

    NOTE: All of these are to be added on the same <string> </string> line!

    ***END GENERAL MAC OS X INFO***

    That's it for now. If anyone thinks of anymore, or I think of anymore, I will add them to this guide. Enjoy! This was copy pasted straight out of my topic on OSX86 project. ;P
    Last edited by DaxTsurugi; 05-25-2006 at 01:04 PM.



  2. #2
    Newbie Array

    Join Date
    May 2006
    Posts
    3
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    DaxTsurugi, thank for your detailed info.

  3. #3
    Newbie Array

    Join Date
    Apr 2006
    Posts
    6
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by chival4ry
    DaxTsurugi, thanks for your detailed info.
    Not a problem.

  4. #4
    Newbie Array

    Join Date
    Apr 2007
    Posts
    1
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Hi,

    can someone tell me where to put aliases for bash?

    br, M

  5. #5
    Newbie Array

    Join Date
    May 2008
    Posts
    3
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    @fish

    for example
    alias dir="ls -l"

    this creates the alias dir
    :-)


  6. #6
    Newbie Array

    Join Date
    Aug 2008
    Posts
    4
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    this is realy basic

  7. #7
    Newbie Array

    Join Date
    Sep 2008
    Posts
    9
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I will tried to remember these ^^! new to mac

  8. #8
    Newbie Array

    Join Date
    Sep 2008
    Posts
    3
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I wrote a large tut for this as well. I like it alot better than CMD.
    Good guide.

  9. #9
    Rookie Array

    Join Date
    Oct 2007
    Posts
    16
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    thx for the list above, DaxTsurugi

    does anyone know a command to install a network printer via terminal? it would be really great!

    Bavaria rocks!

  10. #10
    Senior Professional Array JayBird's Avatar

    Join Date
    Oct 2008
    Posts
    373
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    27

    Default

    great post, i've been after some info like this!!
    I Do Not Condone Piracy, If You Like It BUY IT! - It's Ok To Test But Not Steal - MacBook Pro Owner

    iPhone Owner 3G


 

 
Page 1 of 2 12 LastLast

LinkBacks (?)

  1. 01-22-2009, 05:58 AM

Similar Threads

  1. How to execute Shell or Terminal commands in App? : (unzip)
    By rjshearman in forum Free Toolchain Software (Cydia App's)
    Replies: 3
    Last Post: 11-02-2008, 07:43 PM
  2. [Terminal] Fix for SuidLibFix: Main Script Execution failed (Terminal Password)
    By GuGaPires in forum Free Toolchain Software (Cydia App's)
    Replies: 1
    Last Post: 07-08-2008, 11:29 AM
  3. [1.1.4][Mobile Terminal][Solved]Terminal Hangs.. what's my next move .. ?
    By wackotm in forum Free Toolchain Software (Cydia App's)
    Replies: 1
    Last Post: 05-15-2008, 05:04 AM
  4. Replies: 3
    Last Post: 01-22-2008, 05:19 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 02:48 PM.
twitter, follow us!