Getting random “cd: Too many arguments.” error messages when using different commands












1














I am getting random "cd: Too many arguments." when using different commands, for example newgrp or when logging in. Here is a console log showing the issue along with the Linux version and shell type.



Last login: Mon Jun  4 10:50:58 2018 from somewhere.com
cd: Too many arguments.
myServerName /home/myUserName>
myServerName /home/myUserName>
myServerName /home/myUserName>
myServerName /home/myUserName>
myServerName /home/myUserName> groups
groupA groupB
myServerName /home/myUserName> newgrp groupB
cd: Too many arguments.
myServerName /home/myUserName> groups
groupB groupA
myServerName /home/myUserName> uname -or
2.6.32-696.13.2.el6.x86_64 GNU/Linux
myServerName /home/myUserName> lsb_release -irc
Distributor ID: RedHatEnterpriseServer
Release: 6.9
Codename: Santiago
myServerName /home/myUserName> echo $0
tcsh
myServerName /home/myUserName>


newgrp command actually runs fine, still I would like to get rid of this message.



Unfortunately searching online had no real results as all of them were about cd command itself.



I would welcome some help in tracking this issue down.



Update



myServerName /home/myUserName> grep "cd " ~/.tcshrc ~/.cshrc ~/.login
grep: /home/myUserName/.tcshrc: No such file or directory
myServerName /home/myUserName> grep "cd " ~/.cshrc ~/.login
myServerName /home/myUserName>




~/.cshrc ~/.login files:



# ----------------------------------------------------------------------------                        |# ----------------------------------------------------------------------------G
# Name : .login |# Name : .cshrc
# Function : users startup-file for csh and tcsh |# Function : Users startup-file for csh and tcsh
# |#
# Note : Please do not edit this file until you have read the |# Note : Please do not edit this file until you have read the
# site policy file for dot-files: /etc/home/README |# site policy file for dot-files: /etc/home/README.*
# |#
# ---------------------------------------------------------------------------- |# ----------------------------------------------------------------------------
if (-r /etc/home/login && -d /env) then |if (-r /etc/home/cshrc && -d /env) then
source /etc/home/login | source /etc/home/cshrc
else |else
source .login.old | source .cshrc.old
endif |endif









share|improve this question




















  • 2




    It appears to me that you have a cd command in your startup files somewhere. Try: grep "cd " ~/.tcshrc ~/.cshrc ~/.login. It may be globally-set somewhere, instead: grep "cd " /etc/csh.cshrc /etc/csh.login
    – Jeff Schaller
    Jun 4 at 15:26










  • The gorups command (and uname and lsb_release) didn't prompt (so to speak) the cd message, so it doesn't seem to me to be prompt-command-related.
    – Jeff Schaller
    Jun 4 at 15:27










  • @UlrichSchwarz tcsh does not have export, but it has printenv. It's more likely that there is some weirdness in ~/.tcshrc, ~/.cshrc or ~/.login though.
    – Kusalananda
    Jun 4 at 15:29










  • @JeffSchaller None of them gave any results.
    – Bence Kaulics
    Jun 4 at 15:39






  • 2




    @Kusalananda You were right the problem is with the source command in the ~/.cshrc and ~/.login. I had tried it out manually and found out that the .cshrc.user has an alias named source (cd /somedir) that has overridden the original command. Good example why not copy someone else aliases.
    – Bence Kaulics
    Jun 4 at 15:43


















1














I am getting random "cd: Too many arguments." when using different commands, for example newgrp or when logging in. Here is a console log showing the issue along with the Linux version and shell type.



Last login: Mon Jun  4 10:50:58 2018 from somewhere.com
cd: Too many arguments.
myServerName /home/myUserName>
myServerName /home/myUserName>
myServerName /home/myUserName>
myServerName /home/myUserName>
myServerName /home/myUserName> groups
groupA groupB
myServerName /home/myUserName> newgrp groupB
cd: Too many arguments.
myServerName /home/myUserName> groups
groupB groupA
myServerName /home/myUserName> uname -or
2.6.32-696.13.2.el6.x86_64 GNU/Linux
myServerName /home/myUserName> lsb_release -irc
Distributor ID: RedHatEnterpriseServer
Release: 6.9
Codename: Santiago
myServerName /home/myUserName> echo $0
tcsh
myServerName /home/myUserName>


newgrp command actually runs fine, still I would like to get rid of this message.



Unfortunately searching online had no real results as all of them were about cd command itself.



I would welcome some help in tracking this issue down.



Update



myServerName /home/myUserName> grep "cd " ~/.tcshrc ~/.cshrc ~/.login
grep: /home/myUserName/.tcshrc: No such file or directory
myServerName /home/myUserName> grep "cd " ~/.cshrc ~/.login
myServerName /home/myUserName>




~/.cshrc ~/.login files:



# ----------------------------------------------------------------------------                        |# ----------------------------------------------------------------------------G
# Name : .login |# Name : .cshrc
# Function : users startup-file for csh and tcsh |# Function : Users startup-file for csh and tcsh
# |#
# Note : Please do not edit this file until you have read the |# Note : Please do not edit this file until you have read the
# site policy file for dot-files: /etc/home/README |# site policy file for dot-files: /etc/home/README.*
# |#
# ---------------------------------------------------------------------------- |# ----------------------------------------------------------------------------
if (-r /etc/home/login && -d /env) then |if (-r /etc/home/cshrc && -d /env) then
source /etc/home/login | source /etc/home/cshrc
else |else
source .login.old | source .cshrc.old
endif |endif









share|improve this question




















  • 2




    It appears to me that you have a cd command in your startup files somewhere. Try: grep "cd " ~/.tcshrc ~/.cshrc ~/.login. It may be globally-set somewhere, instead: grep "cd " /etc/csh.cshrc /etc/csh.login
    – Jeff Schaller
    Jun 4 at 15:26










  • The gorups command (and uname and lsb_release) didn't prompt (so to speak) the cd message, so it doesn't seem to me to be prompt-command-related.
    – Jeff Schaller
    Jun 4 at 15:27










  • @UlrichSchwarz tcsh does not have export, but it has printenv. It's more likely that there is some weirdness in ~/.tcshrc, ~/.cshrc or ~/.login though.
    – Kusalananda
    Jun 4 at 15:29










  • @JeffSchaller None of them gave any results.
    – Bence Kaulics
    Jun 4 at 15:39






  • 2




    @Kusalananda You were right the problem is with the source command in the ~/.cshrc and ~/.login. I had tried it out manually and found out that the .cshrc.user has an alias named source (cd /somedir) that has overridden the original command. Good example why not copy someone else aliases.
    – Bence Kaulics
    Jun 4 at 15:43
















1












1








1







I am getting random "cd: Too many arguments." when using different commands, for example newgrp or when logging in. Here is a console log showing the issue along with the Linux version and shell type.



Last login: Mon Jun  4 10:50:58 2018 from somewhere.com
cd: Too many arguments.
myServerName /home/myUserName>
myServerName /home/myUserName>
myServerName /home/myUserName>
myServerName /home/myUserName>
myServerName /home/myUserName> groups
groupA groupB
myServerName /home/myUserName> newgrp groupB
cd: Too many arguments.
myServerName /home/myUserName> groups
groupB groupA
myServerName /home/myUserName> uname -or
2.6.32-696.13.2.el6.x86_64 GNU/Linux
myServerName /home/myUserName> lsb_release -irc
Distributor ID: RedHatEnterpriseServer
Release: 6.9
Codename: Santiago
myServerName /home/myUserName> echo $0
tcsh
myServerName /home/myUserName>


newgrp command actually runs fine, still I would like to get rid of this message.



Unfortunately searching online had no real results as all of them were about cd command itself.



I would welcome some help in tracking this issue down.



Update



myServerName /home/myUserName> grep "cd " ~/.tcshrc ~/.cshrc ~/.login
grep: /home/myUserName/.tcshrc: No such file or directory
myServerName /home/myUserName> grep "cd " ~/.cshrc ~/.login
myServerName /home/myUserName>




~/.cshrc ~/.login files:



# ----------------------------------------------------------------------------                        |# ----------------------------------------------------------------------------G
# Name : .login |# Name : .cshrc
# Function : users startup-file for csh and tcsh |# Function : Users startup-file for csh and tcsh
# |#
# Note : Please do not edit this file until you have read the |# Note : Please do not edit this file until you have read the
# site policy file for dot-files: /etc/home/README |# site policy file for dot-files: /etc/home/README.*
# |#
# ---------------------------------------------------------------------------- |# ----------------------------------------------------------------------------
if (-r /etc/home/login && -d /env) then |if (-r /etc/home/cshrc && -d /env) then
source /etc/home/login | source /etc/home/cshrc
else |else
source .login.old | source .cshrc.old
endif |endif









share|improve this question















I am getting random "cd: Too many arguments." when using different commands, for example newgrp or when logging in. Here is a console log showing the issue along with the Linux version and shell type.



Last login: Mon Jun  4 10:50:58 2018 from somewhere.com
cd: Too many arguments.
myServerName /home/myUserName>
myServerName /home/myUserName>
myServerName /home/myUserName>
myServerName /home/myUserName>
myServerName /home/myUserName> groups
groupA groupB
myServerName /home/myUserName> newgrp groupB
cd: Too many arguments.
myServerName /home/myUserName> groups
groupB groupA
myServerName /home/myUserName> uname -or
2.6.32-696.13.2.el6.x86_64 GNU/Linux
myServerName /home/myUserName> lsb_release -irc
Distributor ID: RedHatEnterpriseServer
Release: 6.9
Codename: Santiago
myServerName /home/myUserName> echo $0
tcsh
myServerName /home/myUserName>


newgrp command actually runs fine, still I would like to get rid of this message.



Unfortunately searching online had no real results as all of them were about cd command itself.



I would welcome some help in tracking this issue down.



Update



myServerName /home/myUserName> grep "cd " ~/.tcshrc ~/.cshrc ~/.login
grep: /home/myUserName/.tcshrc: No such file or directory
myServerName /home/myUserName> grep "cd " ~/.cshrc ~/.login
myServerName /home/myUserName>




~/.cshrc ~/.login files:



# ----------------------------------------------------------------------------                        |# ----------------------------------------------------------------------------G
# Name : .login |# Name : .cshrc
# Function : users startup-file for csh and tcsh |# Function : Users startup-file for csh and tcsh
# |#
# Note : Please do not edit this file until you have read the |# Note : Please do not edit this file until you have read the
# site policy file for dot-files: /etc/home/README |# site policy file for dot-files: /etc/home/README.*
# |#
# ---------------------------------------------------------------------------- |# ----------------------------------------------------------------------------
if (-r /etc/home/login && -d /env) then |if (-r /etc/home/cshrc && -d /env) then
source /etc/home/login | source /etc/home/cshrc
else |else
source .login.old | source .cshrc.old
endif |endif






command-line rhel cd-command tcsh






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 4 at 15:35

























asked Jun 4 at 15:21









Bence Kaulics

1065




1065








  • 2




    It appears to me that you have a cd command in your startup files somewhere. Try: grep "cd " ~/.tcshrc ~/.cshrc ~/.login. It may be globally-set somewhere, instead: grep "cd " /etc/csh.cshrc /etc/csh.login
    – Jeff Schaller
    Jun 4 at 15:26










  • The gorups command (and uname and lsb_release) didn't prompt (so to speak) the cd message, so it doesn't seem to me to be prompt-command-related.
    – Jeff Schaller
    Jun 4 at 15:27










  • @UlrichSchwarz tcsh does not have export, but it has printenv. It's more likely that there is some weirdness in ~/.tcshrc, ~/.cshrc or ~/.login though.
    – Kusalananda
    Jun 4 at 15:29










  • @JeffSchaller None of them gave any results.
    – Bence Kaulics
    Jun 4 at 15:39






  • 2




    @Kusalananda You were right the problem is with the source command in the ~/.cshrc and ~/.login. I had tried it out manually and found out that the .cshrc.user has an alias named source (cd /somedir) that has overridden the original command. Good example why not copy someone else aliases.
    – Bence Kaulics
    Jun 4 at 15:43
















  • 2




    It appears to me that you have a cd command in your startup files somewhere. Try: grep "cd " ~/.tcshrc ~/.cshrc ~/.login. It may be globally-set somewhere, instead: grep "cd " /etc/csh.cshrc /etc/csh.login
    – Jeff Schaller
    Jun 4 at 15:26










  • The gorups command (and uname and lsb_release) didn't prompt (so to speak) the cd message, so it doesn't seem to me to be prompt-command-related.
    – Jeff Schaller
    Jun 4 at 15:27










  • @UlrichSchwarz tcsh does not have export, but it has printenv. It's more likely that there is some weirdness in ~/.tcshrc, ~/.cshrc or ~/.login though.
    – Kusalananda
    Jun 4 at 15:29










  • @JeffSchaller None of them gave any results.
    – Bence Kaulics
    Jun 4 at 15:39






  • 2




    @Kusalananda You were right the problem is with the source command in the ~/.cshrc and ~/.login. I had tried it out manually and found out that the .cshrc.user has an alias named source (cd /somedir) that has overridden the original command. Good example why not copy someone else aliases.
    – Bence Kaulics
    Jun 4 at 15:43










2




2




It appears to me that you have a cd command in your startup files somewhere. Try: grep "cd " ~/.tcshrc ~/.cshrc ~/.login. It may be globally-set somewhere, instead: grep "cd " /etc/csh.cshrc /etc/csh.login
– Jeff Schaller
Jun 4 at 15:26




It appears to me that you have a cd command in your startup files somewhere. Try: grep "cd " ~/.tcshrc ~/.cshrc ~/.login. It may be globally-set somewhere, instead: grep "cd " /etc/csh.cshrc /etc/csh.login
– Jeff Schaller
Jun 4 at 15:26












The gorups command (and uname and lsb_release) didn't prompt (so to speak) the cd message, so it doesn't seem to me to be prompt-command-related.
– Jeff Schaller
Jun 4 at 15:27




The gorups command (and uname and lsb_release) didn't prompt (so to speak) the cd message, so it doesn't seem to me to be prompt-command-related.
– Jeff Schaller
Jun 4 at 15:27












@UlrichSchwarz tcsh does not have export, but it has printenv. It's more likely that there is some weirdness in ~/.tcshrc, ~/.cshrc or ~/.login though.
– Kusalananda
Jun 4 at 15:29




@UlrichSchwarz tcsh does not have export, but it has printenv. It's more likely that there is some weirdness in ~/.tcshrc, ~/.cshrc or ~/.login though.
– Kusalananda
Jun 4 at 15:29












@JeffSchaller None of them gave any results.
– Bence Kaulics
Jun 4 at 15:39




@JeffSchaller None of them gave any results.
– Bence Kaulics
Jun 4 at 15:39




2




2




@Kusalananda You were right the problem is with the source command in the ~/.cshrc and ~/.login. I had tried it out manually and found out that the .cshrc.user has an alias named source (cd /somedir) that has overridden the original command. Good example why not copy someone else aliases.
– Bence Kaulics
Jun 4 at 15:43






@Kusalananda You were right the problem is with the source command in the ~/.cshrc and ~/.login. I had tried it out manually and found out that the .cshrc.user has an alias named source (cd /somedir) that has overridden the original command. Good example why not copy someone else aliases.
– Bence Kaulics
Jun 4 at 15:43












1 Answer
1






active

oldest

votes


















0














The problem was in the ~/.cshrc ~/.login scripts:



# ----------------------------------------------------------------------------    
# Name : .login
# Function : users startup-file for csh and tcsh
#
# Note : Please do not edit this file until you have read the
# site policy file for dot-files: /etc/home/README
#
# ----------------------------------------------------------------------------
if (-r /etc/home/login && -d /env) then
source /etc/home/login
else
source .login.old
endif


The source command was overridden by an alias that was a shortcut to some directory. Removing the alias fixed the issue.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f447803%2fgetting-random-cd-too-many-arguments-error-messages-when-using-different-com%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    The problem was in the ~/.cshrc ~/.login scripts:



    # ----------------------------------------------------------------------------    
    # Name : .login
    # Function : users startup-file for csh and tcsh
    #
    # Note : Please do not edit this file until you have read the
    # site policy file for dot-files: /etc/home/README
    #
    # ----------------------------------------------------------------------------
    if (-r /etc/home/login && -d /env) then
    source /etc/home/login
    else
    source .login.old
    endif


    The source command was overridden by an alias that was a shortcut to some directory. Removing the alias fixed the issue.






    share|improve this answer




























      0














      The problem was in the ~/.cshrc ~/.login scripts:



      # ----------------------------------------------------------------------------    
      # Name : .login
      # Function : users startup-file for csh and tcsh
      #
      # Note : Please do not edit this file until you have read the
      # site policy file for dot-files: /etc/home/README
      #
      # ----------------------------------------------------------------------------
      if (-r /etc/home/login && -d /env) then
      source /etc/home/login
      else
      source .login.old
      endif


      The source command was overridden by an alias that was a shortcut to some directory. Removing the alias fixed the issue.






      share|improve this answer


























        0












        0








        0






        The problem was in the ~/.cshrc ~/.login scripts:



        # ----------------------------------------------------------------------------    
        # Name : .login
        # Function : users startup-file for csh and tcsh
        #
        # Note : Please do not edit this file until you have read the
        # site policy file for dot-files: /etc/home/README
        #
        # ----------------------------------------------------------------------------
        if (-r /etc/home/login && -d /env) then
        source /etc/home/login
        else
        source .login.old
        endif


        The source command was overridden by an alias that was a shortcut to some directory. Removing the alias fixed the issue.






        share|improve this answer














        The problem was in the ~/.cshrc ~/.login scripts:



        # ----------------------------------------------------------------------------    
        # Name : .login
        # Function : users startup-file for csh and tcsh
        #
        # Note : Please do not edit this file until you have read the
        # site policy file for dot-files: /etc/home/README
        #
        # ----------------------------------------------------------------------------
        if (-r /etc/home/login && -d /env) then
        source /etc/home/login
        else
        source .login.old
        endif


        The source command was overridden by an alias that was a shortcut to some directory. Removing the alias fixed the issue.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Dec 11 at 12:04

























        answered Jun 5 at 7:09









        Bence Kaulics

        1065




        1065






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f447803%2fgetting-random-cd-too-many-arguments-error-messages-when-using-different-com%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Morgemoulin

            Scott Moir

            Souastre