Accessing Bash Command on Lion OS X.

Hello Apple Forum Community.  Can anyone help me to understand how you access Bash in Lion (through which Utilities)?  If you are not a professional programmer or developer, is Bash command still worthy of being educated about on your Mac?  A website was describing a Bash command prompt for UNIX passwords; hence, could using Bash to generate and/or organize your passwords be your best bet?  Should we really trust 'random password generator' websites to create UNIX passwords, or are we simply wasting our time if we are really not creating the proper password for our Lion OS X. 
What other functions can Bash be useful for?  Are there a few simple ways to know and/or get into Bash (to know a few advantageous command prompts) for the general Mac user.  Are any Bash commands different for OS X Lion, or are there new ones as well? Thanks.

Open Applications->Utilities->Terminal.
I believe the default shell for at least the last few releases is bash, so you'll get straight to it (though I have mine set to tcsh). If not, just type /bin/bash to start a bash shell.
Random password generator sites are fine  - all they do is generate a random sequence of characters. However, you're probably going to have to write that password down to remember it, which makes it less secure. Better to come up with a sequence that has some mnemonic meaning to you, that contains uppercase and lowercase letters, numbers and other characters, and is at least eight characters long.
I doubt there's any need for the "general Mac user" to be using a shell, but if you are interested in programming or getting to know how the OS works "under the hood", then it's worth learning about. There are any number of good resources on the web about UNIX shells.

Similar Messages

  • Bash commands not working after upgrade to Lion

    After upgrade, many BASH commands not working. For example, such a fundamental thing as "ls". 
    iMac20:bin a$ ls
    Launch of "ls" failed: the PowerPC architecture is no longer supported.
    What does it have to do with PowerPC? My computer is 2.66 GHz Inter Core Duo

    Linc,
    iMac20:~ a$ which ls
    /sw/bin/ls
    Also, I managed to look (using tcsh's ls-F command) into the contents of /usr/. Here's what I see there:
    [iMac20:/bin] a% ls-F
    [*          csh*        echo*       ksh*        mkdir*      rcp*        stty*       wait4path*
    bash*       date*       ed*         launchctl*  mv*         rm*         sync*       zsh*
    cat*        dd*         expr*       link*       pax*        rmdir*      tcsh*      
    chmod*      df*         hostname*   ln*         ps*         sh*         test*      
    cp*         domainname* kill*       ls*         pwd*        sleep*      unlink*    

  • Bash command not working

    After an update from leopard to lion my bash command clear does not work.
    If I open terminal and type clear this happens...
    Last login: Wed Jul  4 19:07:27 on ttys000
    You have new mail.
    pancake:~ machinename$ clear
    Launch of "clear" failed: the PowerPC architecture is no longer supported.
    pancake:~ machinename$
    I have tried to copy a copy of the terminal app from another functioning machine running lion, but when it runns on the upgraded machine the result is the same.
    How can I fix this?

    Sorry I better correct some of the info.
    My bash command clear does not work.
    If I open terminal and type clear this happens...
    The machine was bought with Lion preinstalled and the Migration Assistant was use to transfer everything for a user from a Leopard machine.
    Last login: Wed Jul  4 19:07:27 on ttys000
    You have new mail.
    pancake:~ username$ clear
    Launch of "clear" failed: the PowerPC architecture is no longer supported.
    pancake:~ username$
    When attempting to delete the terminal program on the system it is prevented with the message:
    “Terminal” can’t be modified or deleted because it’s required by Mac OS X.
    I then copied a terminal program from another Lion machine but it shows the same message for the command Clear on this machine, but not the machine it was copied from.
    Any ideas is greatly appreciated...

  • Bash command doesn't work after update

    I just ran pacman -Syu as normal, but some got many errors like below:
    ( 3/11) upgrading binutils
    error: command failed to execute correctly
    and every package except kernel-headers got a error message like that. and then i found most of my bash command doesn't work any more, just like ls and vim. However, some others like pwd and cd still work correctly.
    Any one any ideal?
    Last edited by ranjiao (2009-11-12 13:26:01)

    ranjiao wrote:I removed /lib64 and make a soft link from /lib64 to /lib, as Matlab09 requires a /lib64 containing crt libs.
    is this the cause?
    Yes.
    I've done that before and got into the same problem when updating glibc, the lesson here, don't mess with the default directory structure.

  • Where can I find the LOG file for bash/command history typed into Terminal?

    Where can I find the LOG file for bash/command history typed into Terminal?
    For 2 weeks ago I was searching for a log file on my server. Somehow I opend a file where I could see a list of all bash-commands I had ever entered into OSX Terminal.
    Now I need this file.. but cant find it.
    What is the official location for this LOG file?
    Thank you so much for helping.

    cat .bash_history

  • After upgrading to Lion I can't access time capsule pre lion.

    Last week I backedup to time capsule via cable.
    I then upgraded to Lion.
    After upgrading I backedup to TC again.
    Now my MBP 17  can't access time capsule pre lion. So I can't see any of my last 2 years of Snow Leopard data.

    yikes, I had to move all my years of iPhoto folders/pix from very old iMac to a new HP laptop with PC Vista Home Premium....now finally ready and hoping to do years worth of photo albums! so I go in to these files and of course they don't open...because they're on pc.
    - I am techno ignorant on all this, what can I do? Is there any way I can open these on PC or do I need to go back and reinstall on a very very very old AND slow slow slow mac? these photos were created in 199, 200, 2001 up through 2007 so through many versions of iPhoto and Mac OS. I am hoping I can retrieve them - and very worried I cannot! Would love advice and help.
    - and on a separate note, any good, inexpensive iPhoto and iTunew wizard/tech support professionals out there in the Menlo Park, CA area?

  • Dynamically accessing / changing command in subreport

    We have reports with multiple sub reports. I need to access and change the sub reports command at run time. The code below does not work, it throws the exception "Not supported within subreports."
    CrystalDecisions.ReportAppServer.DataDefModel.ISCRTable Tbl;
    CrystalDecisions.ReportAppServer.DataDefModel.CommandTable cmdTbl;
    string rptCommand;
    for (int j=0 ; j<crReportDocument.Subreports.Count; j++){
    ReportDocument subReportDocument = crReportDocument.Subreports[j]; //crReportDocument holds the main report
    Tbl = subReportDocument.ReportClientDocument.DatabaseController.Database.Tables<i>; //No Database Controller in subreports - exception!
    cmdTbl = Tbl.Clone(true) as CrystalDecisions.ReportAppServer.DataDefModel.CommandTable;
    rptCommand = cmdTbl.CommandText.ToString();
    How to access the command of the subreports?
    Thanks

    to do this, you will need to use a subreportclientdocument object retrieved from the main report (crReportDocument.ReportClientDocument):
    ISCDReportClientDocument rcd = crReportDocument.ReportClientDocument;
    SubReportClientDocument subRCD = rcd.SubReportController.GetSubreport("mySub");
    // get the command table,
    // clone it,
    // change the commandText
    subRCD.DatabaseController.SetTableLocation(oldTbl, newTbl);
    Dan
    from there, you will have access to all controllers for the subreportclientdocument except the printoutputcontroller.

  • Get "missing operating system" message when trying to access bootcamp since installing Lion.

    I cannot access bootcamp since installing Lion, either through Bootpicker or after holding down the option key after restart.  I get the message "Missing operating system." I have access to the bootcamp partition.  It shows up on my Mac desktop and was able to run disk verify and repair on it from disk utility. No change.  I am using a 2.16 GHz Intel Core 2 Duo processor.  Did Lion relabel the bootcamp disk when it created the recovery disk?  Thanks.

    See here the solution:
    https://discussions.apple.com/thread/3199163?start=0&tstart=0

  • BASH Command.

    How can i use BASH commands to get files Added on a certain month?
    (I can use only date,ls,cut,awk,sed).
    please help if anybody know...

    (I can use only date,ls,cut,awk,sed).
    Pretty restrictive bash script  If that's the only commands you can use.  What's putting on these restrictions?
    Does it have to be a bash script?  Or are you just want something to produce those results?  Because the system's find (command+f) or utilities like Find any File can do this.  Just look for a mod date within a range.
    For bash do a google search for something like "os x bash to get mod date" for script suggestions.

  • Bash update for Lion install correctly?

    I can't tell if the Bash update for Lion installed correctly.  It shows up twice on my desktop and is under devices in finder. It went though all the questions, agreeing and where to install.  I have a Mac mini from early 2009. Running 10.7.5 version of Lion.

    There should be an icon on the Desktop that looks like an external hard drive and is named "bash Update" or something like that. Drag it to the Trash. If you don't see it there, look in the sidebar of a Finder window under DEVICES and click the eject icon. Then look in the Downloads folder for a file with a similar name and drag it to the Trash.

  • Why can't I access the command line I just downloaded for xcode?

    Why I can't access the command line I just downloaded for xcode?

    Firefox will not appear in the Market for most phones with incompatible hardware. I believe the Motorola Bravo is supported. You can check if your phone is supported here:
    https://wiki.mozilla.org/Mobile/Platforms/Android
    On some supported devices, a bug prevents Firefox from appearing in the Market. This may be related to the recent Market update. You can go to Settings/Applications and uninstall the Market update, then find and install Firefox.
    Or, you can download the app directly from here:
    http://ftp.mozilla.org/pub/mozilla.org/mobile/releases/4.0b3/android-r7/multi/
    (Note: To download the app directly for an AT&T phone, you will have to search for instructions on how to "sideload" the APK file, since AT&T disables the option to install from non-Market sources.)

  • Icon to access voice command

    Hi. I'm sure this has been requested before so feel free to merge threads...
    I would like the option to add an icon to my homescreen to access voice command, as an alternative to holding in the home button.
    Thanks.

    I find, currently, that I am still using vLingo (free app) to do some of the things I can now do with voice command because I like that I can access it with the icon on my homescreen.
    It seems silly to need an additional app to do something that is now covered by a default app, just because it doesn't have a preferred way to access it... such as a shortcut icon.
    Additional thoughts from other users are most welcome.
    Thanks for reading.

  • Executing a bash command from Java

    I want to execute a bash command from within a Java application on the server. I know how to do simple commands, but this command is killing me. I get nothing back when I send it.
    p = Runtime.getRuntime().exec(new String[]{"ps","-ef","","grep","evolution"});
    There is also another part where I want the results piped to awk and fetch out the pids. BUt with this not working the rest is a waste for now.
    Robbie

    evgeni00 wrote:
    Thank you for assuming the posters' stupidity.I can only see the information that you provide. You didn't say you tried the recommendations.
    I read the article and I tried the things he/she is proposing, also the error stream, guess what it outputs: nothing.Maybe you did it wrong. If you didn't do it wrong, then that program you're invoking is poorly written, because it dies in error without producing any error messages.
    And I also searched for the exitValue 138, but didn't get much further than that its some system specific value. If you know where I can find more information, I would appreciate if you let me know about it. As jschell pointed out it's probably app specific. You can search the source code and/or documentation of that program to see if they say what 138 means.
    Apart from that -- it seems that environment and run directory issues can trip this up. Try checking that stuff out. Maybe your program expects something on the executable PATH that isn't there. Or maybe you're not running it in the working directory that you think you are.

  • How do I run a snmpwalk/any bash command as a Linux/Unix command (2 state monitor) on a Isilon storage device

    Is there a way that I can run a snmpwalk / isi devices (to find the status of the disk drives in islon) / any Linux bash command using a 2 state monitor Unix/Linux shell command and target a storage device (Isilon in my case) and not target a Unix/Linux
    machine. I tried creating one and it complained saying,
    Is there a way I could run a bash command in my isilon storage and use the ouput to determine the state of the monitor? Please let me know
    Hari V

    For Unix/Linux shell command in Operation Manager to monitor 2 state, you can refer to below link
    http://contoso.se/blog/?p=2680
    http://stefanroth.net/2012/10/21/scom-2012-linux-two-state-monitor-with-script-in-script/
    http://operatingquadrant.com/2012/02/01/opsmgr-2012-unixlinux-authoring-templates-more-information-on-the-shell-command-templates/#more-746
    Please remember, if you see a post that helped you please click (Vote As Helpful" and if it answered your question, please click (Mark As Answer).

  • Accessing Unix-commands via JNI

    Hello everyone,
    I'm currently developing for an Solaris - SPARC - environment a java application, which is processing a huge amount of files without out GUI.
    As there are some limitations the Java-File - Object gives me in respect of the desired platform-independency of java, I'm right now looking for a way of using Unix - commands like "ln" or "ls" via JNI. I have no problem with accessing this commands vie the Runtime.exec(command) - construct. But the overhead which it leads to, because every time a new Unix-Process ist forked to execute the command, is not acceptable for me.
    I see a slight chance of using JNI, but I can't figure out, how to acces the Unix-Calls, I'd like to execute. Could anyone give me a hint.
    Thank You a lot.
    Thomas

    I have no problem with accessing this
    commands vie the Runtime.exec(command) - construct.
    But the overhead which it leads to, because every time
    a new Unix-Process ist forked to execute the command,
    is not acceptable for me.Just create a background shell process that you feed commands when you need to.
    This example should get you started.import java.io.*;
    class PipeSh {
        private Process sh;
        private OutputStream shIn;
        private BufferedReader shOut;
        private BufferedReader shErr;
        PipeSh() {
            try {
                sh = Runtime.getRuntime().exec("sh");
                shIn = sh.getOutputStream();
                shOut = new BufferedReader(new InputStreamReader(sh.getInputStream()));
                shErr = new BufferedReader(new InputStreamReader(sh.getErrorStream()));
            } catch (IOException ex) { ex.printStackTrace(); }
        void execute(String cmd) {
            try {
                shIn.write(cmd.getBytes());
                shIn.flush();
                while (shOut.ready()) System.out.println(shOut.readLine());
                while (shErr.ready()) System.out.println(shErr.readLine());
            } catch (IOException ex) { ex.printStackTrace(); }
        private static String[] cmd = { "mkdir foo\n", "cd foo\n", "touch bar\n" };
        public static void main(String[] arg) {
            PipeSh ps = new PipeSh();
            for (int i=0;i<cmd.length;++i) ps.execute(cmd);

Maybe you are looking for