cygwin: access windows disk, directories and files

Cygwin puts a Linux‑like shell on your Windows desktop. In this quick tip, I’ll show you how to browse your Windows drives and files straight from the Cygwin terminal.

Listing Windows directories and files in Cygwin
From the bash shell, go to the root directory with cd /. Next, list the contents—use ls or dir—and you’ll spot a directory called cygdrive. That’s where all your Windows drives are mounted. Move into it: cd cygdrive. Run ls again and you’ll see entries like c, d, etc.—each mapping to a drive letter. To access your C: drive, type cd c and press Enter. Now ls shows exactly the same files and folders you’d see in File Explorer.

Commands Used Step by Step:
cd /        navigate to the root of the Cygwin filesystem
cd cygdrive enter the drive mount point
cd c        switch into your Windows C: drive
ls          list the contents of C:

No comments :

Post a Comment

Your Comment and Question will help to make this blog better...