- Published on
Windows Common Batch Commands for Linux Users
Creating an empty file
creating an empty file in the current directory:
$ touch sample.txt
> echo. > sample.txt
Creating an empty directory
For creating an empty directory in the current directory, both share the same command:
mkdir new_folder
Show a list of files and folders
show list of the current directory:
$ ls
> dir
Copying a file or directory
copying a file:
$ cp sample.txt sample2.txt
> copy sample.txt sample2.txt
copying a directory:
$ cp new_folder new_folder2
NOTE:
In Windows, we can’t copy an empty directory. Use mkdir
instead.
> copy new_folder new_folder
Moving a file or directory
moving a file:
$ mv folder1/file1.txt folder2/file1.txt
> move folder1\file1.txt folder2\file1.txt
moving a folder:
$ mv folder2 folder1
> move folder2 folder1
Display a file content
$ cat file1.txt
> type file1.txt