How to resolve “sh: 0: getcwd() failed: No such file or directory”

Today I was working with git and for that I had created a “workspace” directory which contained some source files. During this activity I opened another terminal and deleted the workspace directory from second terminal, where as the first terminal, I forgot that, I was still inside that deleted “workspace” directory.

When I tried to install git from that deleted directory, I got an error like,

$ sudo apt-get install git

sh: 0: getcwd() failed: No such file or directory

Solution :

This error was occurred because as I mentioned above, I had deleted the current working directory from where I tried to install git from second tab without realised I was working in that deleted directory.

hence the solution to the error “sh: 0: getcwd() failed: No such file or directory” is to come outside that directory or change to some other known directory and tried your command.

$ cd .. 
How To Fix “Failed To Verify Logi... x
How To Fix “Failed To Verify Login Information” for Wild Rift (LoL Mobile)

Leave a Comment

Sign up to our newsletter!

ADB Commands Android Android Applications Android Build system Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development & Build Development, Debugging and Performance Tools Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia NDK / Middleware / HAL Operating System Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web design and development Website Hosting Wordpress Yocto Embedded Linux