Day 2 Task: Basics Linux commands

Day 2 Task: Basics Linux commands

Basic linux commands

Listing commands

ls option arguments --> list the sub directories and files avaiable in the present directory

Here LS Stands for List.

The syntax is ls option arguments

Examples:

ls --> List the files and directories.

ls -l--> list the files and directories in long list format with extra information

ls -a --> list all including hidden files and directory

ls -i --> list the files and directories with index numbers inodes

Ls -ltr -->it prints out a long listing format of files and directories with the latest modification date: List Files by Size

Directoy commands

pwd --> print working directory. Gives the present working directory.

change directory

Syntax is:

cd path_to_directory --> change directory to the provided path

cd ~ or just cd --> change directory to the home directory

cd - --> Go to the last working directory.

cd .. --> change directory to one step back.

cd ../.. --> Change directory to 2 levels back.

mkdir directoryName --> to make a directory in a specific location

Here mkdir means Make a Directory

Examples:

mkdir demo_file --> make a new folder 'demo_file'

mkdir .Demo_file --> make a hidden directory (also . before a file to make it hidden)

mkdir dir1 dir2 dir3 dir4 -->make multiple directories at the same time

mkdir -p A/B/C/D --> make a nested directory