Skip to content

Instantly share code, notes, and snippets.

@Sanchitbajaj02
Last active April 11, 2023 14:09
Show Gist options
  • Save Sanchitbajaj02/333a6ed5ceceacabf7e83397f3a31c7d to your computer and use it in GitHub Desktop.
Save Sanchitbajaj02/333a6ed5ceceacabf7e83397f3a31c7d to your computer and use it in GitHub Desktop.
Linux Commands in Windows
As everyone know that linux is an open source operating system and based on the unix shell system. Linux uses the command line interface or CLI which generally called as terminal to perform some basic tasks like creating and deleting files and folders, renaming files and folders, copy, cut and paste of files and folders, etc.
---
## Installation of Linux in Windows
There are 2 methods to access linux shell in windows.
First is to install WSL(Windows Subsystem for Linux) which is basically a service by Microsoft to install Linux as an application on top of Windows.
The other method which is easier than the former is to install git bash into the system.
Git-bash is version control tool which acts as a linux terminal with some restricted feature.
The commands that I am going to mention are the ones which are common for both the platforms.
## Linux Commands
~/ ls
This command files present in the current folder.
~/ ls -l
This command shows the files of the current folder with their access rights and date of modification.
~/ ls -a
This command shows the hidden files within the folder.
~/ pwd
This command shows the path of your current folder.
~/ mkdir folder-name
Creates the folder in the current directory.
~/ touch file-name
Creates a file within a directory.
~/ cat file-name
Displays the content in a file in the shell.
~/ mv source-file target-directory
This command is used to move files from one place to another. It is also used to rename a file.
~/ cp source-file target-directory
This command is used to copy files from one place to another.
~/ rm file-name
This command deletes the file in the directory.
~/ rmdir directory-name
This command deletes the mentioned directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment