0% found this document useful (0 votes)
3 views

Basic Linux Commands

This document provides a list of basic Linux commands along with their functions. It includes commands for navigating directories, managing files and folders, creating and editing files, and viewing file contents. Each command is accompanied by examples for clarity.

Uploaded by

amsi71131
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Basic Linux Commands

This document provides a list of basic Linux commands along with their functions. It includes commands for navigating directories, managing files and folders, creating and editing files, and viewing file contents. Each command is accompanied by examples for clarity.

Uploaded by

amsi71131
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Basic Linux commands:

# pwd -> present working directory - checks the current/ present directory where you
asre working

# ls -> lists all the files and folders in the current directory

# ls -l -> Long listing of files and folders in the current directory

# ls -la -> Long listing of files and folders including hidden files and folders in
the current directory

# mkdir <dir_name> -> Create a new directory.


eg: mkdir my_dir

# cd <dir_name> -> Change directory to the given directory.


eg:
cd my_dir -> Change directory to 'my_dir'
cd .. -> To change directory to previous directory.

# rmdir <dir_name> -> Removes the directory (if the directory is empty)

# rm <file> -> Removes a file

# rm -f <file> -> Removes a file forcefully

# rm -r <dir name> -> Removes the directory recursively

# touch <filename> -> Creates an empty file


eg: touch a.txt

# vim -> Power tool/ editor for text files used in command line.
eg:
vim a.txt -> To open the file.
i -> To go to insert mode
esc -> To exit the insert mode
:wq -> Saves and exit the file
:q -> Exits the file without saving
:wq! -> Forcefullt saves and exits the file
:q! -> Forcefully exits the file without saving

# cat <file name> -> command to see the content of the file.
eg:
cat a.txt

You might also like