Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

terminal help!

hi guys,


this happens when i log in to it:


login: illegal option -- L

usage: login [-pq] [-h hostname] [username]

login -f [-lpq] [-h hostname] [username [prog [arg ...]]]


[Process completed]



i can't type anything into it and couldn't find any help regarding this issue!

does anyone know what i can do to use terminal again?

have tried disk utility repairs and new shells but nothing works


thanks!

MacBook Air (13-inch, Early 2014)

Posted on Nov 11, 2018 8:32 PM

Reply
8 replies

Nov 13, 2018 6:07 AM in response to hopsiwel

Look at the following information to see if it agrees with this test account. Actually, you can compare your normal account against your working test account as well.


When you have the failed Terminal window open, Control-Click -> Show Inspector

User uploaded file

In that window what does it say in the middle about your Login?

User uploaded file

I'm mainly interested in the "Command" and "Shell" information


Using Terminal -> Preferences -> General, what does the window look like.

User uploaded file

I'm interested in the "Shells open with" section, and if you have "Default" or "Command" specified.


Looking a Terminal -> Preferences -> Profiles -> Shell, what does this window look like

User uploaded file

I'm mostly interested in the "Run Command"


Finally, what does the output from the following command look like:

Terminal -> Shell -> New Command ->

dscl . -read /Users/YOUR_SHORT_UNIX_NAME_HERE shell

I expect to see

dsAttrTypeNative:shell: /bin/bash

Nov 12, 2018 6:09 AM in response to hopsiwel

Start by moving your com.apple.Terminal.plist file out of the Preferences folder

Quit from the Terminal app

Finder -> Go -> Go to folder -> ~/Library/Preferences

The ~ is the Tilda character often found on the upper left corner of your keyboard.

Relaunch Terminal


If that does not clear up the problem.

Look for one of the following files in your home directory (which is going to be fun trying to see as they are not normally displayed by the Finder)

  • .bash_profile
  • .bash_login
  • .profile
  • .bashrc

But you can most likely see them if you use

Terminal -> Shell -> New Command -> ls -a

By default none of these files exist, so you may not find them. But if you do fine one of them you want to rename so that the shell will not look at them

Terminal -> Shell -> New Command -> mv .bash_profile save.bash_profile

Terminal -> Shell -> New Command -> mv .bash_login save.bash_login

Terminal -> Shell -> New Command -> mv .profile save.profile

Terminal -> Shell -> New Command -> mv .bashrc save.bashrc

Obviously, only use one of these commands if the file in question exists.

Quit Terminal

Relaunch Terminal


If that does not work, then create a new account, as an experiment, and try Terminal in the new account

System Preferences -> Users & Groups

Click on the padlock in the lower left-hand corner if the padlock is locked

Click on the [+] to add a new account.

Again, this is an experiment to see if the problem continues.

Then let us know the results of the experiment, as we will still want to figure out what is going wrong in your normal account.

Nov 12, 2018 6:22 AM in response to BobHarris

i couldn't find com.apple.Terminal.plist anymore! i was able to locate it yesterday but it's gone from the folder now


Edit:

So, i've tried locating all the files using terminal-> new shell but they are all not there.

I then created a new account and terminal is usable on that account but still not on my main one which is really weird!

Nov 12, 2018 6:39 AM in response to hopsiwel

When you launch Terminal, it always creates a new com.apple.Terminal.plist, so you should have one.


The fact that a new account works correctly, strongly points to something about your current environment.


And based on the symptoms you are reporting, it really does sound like a broken .plist file.


But just to be safe, I'll ask. Do you have any System Preferences -> <your account> -> Startup Items? While I do not expect any of them to interfere with Terminal, it is best to ask the question. If you do, try removing them. Logout, login to your main account and try again.


But really, com.apple.Terminal.plist is the most likely problem.

terminal help!

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.