How to quickly cd to the correct directory? [closed]












0















Is there any way to quickly cd to the correct directory? I have a lot of subdirectories for my courses and it ends up taking lots of time to cd to get to the correct directory. Especially if I forget the name of the directory.



Are there any tips as good ways to easily get to the correct directory?










share|improve this question













closed as unclear what you're asking by Steven, DavidPostill Jan 26 at 20:51


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • 3





    There are answers, but they are very different, depending on the OS, but I'm not sure what help you can expect if you forget the name.

    – AFH
    Jan 26 at 20:31











  • Most of the time you can type cd and hit the tab key - sometime more then once to expand and show valid options

    – davidgo
    Jan 26 at 23:52
















0















Is there any way to quickly cd to the correct directory? I have a lot of subdirectories for my courses and it ends up taking lots of time to cd to get to the correct directory. Especially if I forget the name of the directory.



Are there any tips as good ways to easily get to the correct directory?










share|improve this question













closed as unclear what you're asking by Steven, DavidPostill Jan 26 at 20:51


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • 3





    There are answers, but they are very different, depending on the OS, but I'm not sure what help you can expect if you forget the name.

    – AFH
    Jan 26 at 20:31











  • Most of the time you can type cd and hit the tab key - sometime more then once to expand and show valid options

    – davidgo
    Jan 26 at 23:52














0












0








0








Is there any way to quickly cd to the correct directory? I have a lot of subdirectories for my courses and it ends up taking lots of time to cd to get to the correct directory. Especially if I forget the name of the directory.



Are there any tips as good ways to easily get to the correct directory?










share|improve this question














Is there any way to quickly cd to the correct directory? I have a lot of subdirectories for my courses and it ends up taking lots of time to cd to get to the correct directory. Especially if I forget the name of the directory.



Are there any tips as good ways to easily get to the correct directory?







terminal filesystems






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 26 at 19:46









appljuiceappljuice

112




112




closed as unclear what you're asking by Steven, DavidPostill Jan 26 at 20:51


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









closed as unclear what you're asking by Steven, DavidPostill Jan 26 at 20:51


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 3





    There are answers, but they are very different, depending on the OS, but I'm not sure what help you can expect if you forget the name.

    – AFH
    Jan 26 at 20:31











  • Most of the time you can type cd and hit the tab key - sometime more then once to expand and show valid options

    – davidgo
    Jan 26 at 23:52














  • 3





    There are answers, but they are very different, depending on the OS, but I'm not sure what help you can expect if you forget the name.

    – AFH
    Jan 26 at 20:31











  • Most of the time you can type cd and hit the tab key - sometime more then once to expand and show valid options

    – davidgo
    Jan 26 at 23:52








3




3





There are answers, but they are very different, depending on the OS, but I'm not sure what help you can expect if you forget the name.

– AFH
Jan 26 at 20:31





There are answers, but they are very different, depending on the OS, but I'm not sure what help you can expect if you forget the name.

– AFH
Jan 26 at 20:31













Most of the time you can type cd and hit the tab key - sometime more then once to expand and show valid options

– davidgo
Jan 26 at 23:52





Most of the time you can type cd and hit the tab key - sometime more then once to expand and show valid options

– davidgo
Jan 26 at 23:52










1 Answer
1






active

oldest

votes


















1














I wrote this code in bash for changing my programming directory. I called it cpd and everytime I can just call it with cpd py and it will take the shortest pattern, so in my case it's Python.
But if you don't know whole or part of the name, it will be useless.



#!/bin/bash

cd ~/Programing
cd "$(find -type d | grep -i "$(echo "${*:1}" | sed 's/ /.*/g')" | awk '{print length($0) " " $0; }' | sort -n | cut -d ' ' -f2- | head -n 1)"





share|improve this answer






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    I wrote this code in bash for changing my programming directory. I called it cpd and everytime I can just call it with cpd py and it will take the shortest pattern, so in my case it's Python.
    But if you don't know whole or part of the name, it will be useless.



    #!/bin/bash

    cd ~/Programing
    cd "$(find -type d | grep -i "$(echo "${*:1}" | sed 's/ /.*/g')" | awk '{print length($0) " " $0; }' | sort -n | cut -d ' ' -f2- | head -n 1)"





    share|improve this answer




























      1














      I wrote this code in bash for changing my programming directory. I called it cpd and everytime I can just call it with cpd py and it will take the shortest pattern, so in my case it's Python.
      But if you don't know whole or part of the name, it will be useless.



      #!/bin/bash

      cd ~/Programing
      cd "$(find -type d | grep -i "$(echo "${*:1}" | sed 's/ /.*/g')" | awk '{print length($0) " " $0; }' | sort -n | cut -d ' ' -f2- | head -n 1)"





      share|improve this answer


























        1












        1








        1







        I wrote this code in bash for changing my programming directory. I called it cpd and everytime I can just call it with cpd py and it will take the shortest pattern, so in my case it's Python.
        But if you don't know whole or part of the name, it will be useless.



        #!/bin/bash

        cd ~/Programing
        cd "$(find -type d | grep -i "$(echo "${*:1}" | sed 's/ /.*/g')" | awk '{print length($0) " " $0; }' | sort -n | cut -d ' ' -f2- | head -n 1)"





        share|improve this answer













        I wrote this code in bash for changing my programming directory. I called it cpd and everytime I can just call it with cpd py and it will take the shortest pattern, so in my case it's Python.
        But if you don't know whole or part of the name, it will be useless.



        #!/bin/bash

        cd ~/Programing
        cd "$(find -type d | grep -i "$(echo "${*:1}" | sed 's/ /.*/g')" | awk '{print length($0) " " $0; }' | sort -n | cut -d ' ' -f2- | head -n 1)"






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 26 at 20:48









        MatejMatej

        16113




        16113















            Popular posts from this blog

            Plaza Victoria

            Puebla de Zaragoza

            Musa