Inspiration

It's very hard to look up what file you have and operate them under command line, so I need a file manage tool

What it does

show you files when you enter a name, it directly enter the directory that has the name you enter under you current direction copy a direction to clipborad link the direction in the clipboard to the direction you are in.

because I don't have time to upload the code, here is the code

!/bin/zsh

if [-z $1];then cd $1 else cd ~ fi Clipboard = "" green() { echo "\e[32m$1\e[0m" } while true do echo "\e[32m-----------------" echo "'lsfile' File Lookup" echo "$(pwd)\e[0m" ls -AGF while true do echo -n "\e[32m:\e[0m" read operation if [${operation:2} = "q"];then break; fi

    if [[ ${operation} == "//"* ]] ;then
        command = ${operation:2}
        case ${command} in 
            "finder"*)
                if [ ${command} = "finder" ];then
                    open ./
                else
                    open -R ./${command:7}
                fi

            ;;
            "copy "*)
                ${Clipboard} = $(realpath ${command:5})
            ;;
            "reprint")
                break
            ;;
            "cler_clipbrd")
                ${Clipboard} = ""
            ;;
            "link")
                if [ ${Clipboard} = "."* ] || [ ${Clipboard} = "~"* ];them
                    green "'ln' don't support ./ or ~/"
                else
                    ln -s ${Clipboard} ./$(basename ${Clipboard})
                    break
                fi
            *)
            echo ""
        esac
    else
        cd ${operation};
        break
    fi
done

done

Built With

  • basename
  • dirname
  • ls
  • realpath
  • zsh
Share this project:

Updates

Private user

Private user posted an update —

'''

!/bin/zsh

if [-z $1];then cd $1 else cd ~ fi Clipboard = "" green() { echo "\e[32m$1\e[0m" } while true do echo "\e[32m-----------------" echo "'lsfile' File Lookup" echo "$(pwd)\e[0m" ls -AGF while true do echo -n "\e[32m:\e[0m" read operation if [${operation:2} = "q"];then break; fi

    if [[ ${operation} == "//"* ]] ;then
        command = ${operation:2}
        case ${command} in 
            "finder"*)
                if [ ${command} = "finder" ];then
                    open ./
                else
                    open -R ./${command:7}
                fi

            ;;
            "copy "*)
                ${Clipboard} = $(realpath ${command:5})
            ;;
            "reprint")
                break
            ;;
            "cler_clipbrd")
                ${Clipboard} = ""
            ;;
            "link")
                if [ ${Clipboard} = "."* ] || [ ${Clipboard} = "~"* ];them
                    green "'ln' don't support ./ or ~/"
                else
                    ln -s ${Clipboard} ./$(basename ${Clipboard})
                    break
                fi
            *)
            echo ""
        esac
    else
        cd ${operation};
        break
    fi
done

done '''

Log in or sign up for Devpost to join the conversation.

Private user

Private user posted an update —

Looks like the code have some problem to display. Here's the code again: '''zsh

!/bin/zsh

if [-z $1];then cd $1 else cd ~ fi Clipboard = "" green() { echo "\e[32m$1\e[0m" } while true do echo "\e[32m-----------------" echo "'lsfile' File Lookup" echo "$(pwd)\e[0m" ls -AGF while true do echo -n "\e[32m:\e[0m" read operation if [${operation:2} = "q"];then break; fi

    if [[ ${operation} == "//"* ]] ;then
        command = ${operation:2}
        case ${command} in 
            "finder"*)
                if [ ${command} = "finder" ];then
                    open ./
                else
                    open -R ./${command:7}
                fi

            ;;
            "copy "*)
                ${Clipboard} = $(realpath ${command:5})
            ;;
            "reprint")
                break
            ;;
            "cler_clipbrd")
                ${Clipboard} = ""
            ;;
            "link")
                if [ ${Clipboard} = "."* ] || [ ${Clipboard} = "~"* ];them
                    green "'ln' don't support ./ or ~/"
                else
                    ln -s ${Clipboard} ./$(basename ${Clipboard})
                    break
                fi
            *)
            echo ""
        esac
    else
        cd ${operation};
        break
    fi
done

done '''

Log in or sign up for Devpost to join the conversation.

Submission history