Directory / File Management

Creating a new folder/directory:

mkdir directoryname

Changing directory:

cd directoryname

Listing files and directories

ls

Moving files or directories

mv source destinations

Copying files or directories:

cp source destination

Removing files:

rm filename

Removing directories:

rm -r directoryname

Renaming files or directories:

mv oldname newname

Displaying the current working directory:

Creating an Empty File

To display the contents of a single file:

To display the contents of multiple files:

To display the contents of a file along with line numbers:

To concatenate multiple files and display the output:

Last updated