Basic Commands - Ubuntu/Windows

Category


Commands


Find Directory and Files

Displays all files and folders list in the current directory

Windows use dir command and Ubuntu use ls to get list information about the files and directory by default.
Command Prompt
C:\>dir
displays all folders and files of current directory

C:\>dir /p
displays page wise contents at a time

C:\>dir /w
show multiple row wise contents

C:\>dir *.txt
displays all files with the txt extension in the current directory.

C:\>dir /ah
displays all hidden files

C:\>dir a???.*
displays all files starting with a and exactly 4 characters long, and with any extension

C:\>dir a*.jpg /s
search file from current directory and all subfolders thereafter
if you don't know where the file located then you should start from root level of directory c:\

C:\>dir /?
get help of dir command

Ubuntu Terminal
angryuser@host:~$ls
get the list of files and directory

angryuser@host:~$ls -l
get formated list of all files and directory

angryuser@host:~$ls -t
time wise listing

angryuser@host:~$ls *.txt
all files with .txt extension

angryuser@host:~$ls -a
list including hidden files and directory

angryuser@host:~$ls -atl
time wise list of all files and directory including hidden files and directory

angryuser@host:~$man ls
all available options of ls command