BCA / B.Tech 20 min read

Linux Commands

Commands of Linux in Hindi | Linux Commands in Hindi:


Hundreds of commands are used to perform various tasks in Linux. Some common commands are often used, such as creating files, deleting them, creating directories (folders), and other basic tasks. Here all the main commands are explained with their uses.


Commands of Linux in Hindi | Linux Commands in Hindi

Directives and commands to create files in Hindi | Commands to create directories and files

a. Creating a directory (folder) – mkdir

Command: mkdir <directory name>

Example: mkdir my_directory

This command will create a new directory named "my_directory".

b. Creating files – touch

Command: touch <file name>

Example: touch myfile.txt

This command will create a new empty file "myfile.txt".

c. Creating a file and adding text to it – echo and >

Command: echo "<text>" > <file name>

Example: echo "Hello, World!" > myfile.txt

This command will add the text "Hello, World!" to the file "myfile.txt".

Directives and commands to Delete files in Hindi |  Commands to remove directories and files

a. Removing a file – rm

Command: rm <file name>

Example: rm myfile.txt

This command will delete the file "myfile.txt".

b. Removing a directory – rmdir (for an empty directory)

Command: rmdir <directory name>

Example: rmdir my_directory

This command will remove the empty directory named "my_directory".

c. Removing a directory and all its contents – rm -r

Command: rm -r <directory name>

Example: rm -r my_directory

This command will delete "my_directory" and all its files and sub-directories.

Commands for directory navigation in Hindi | Commands for directory navigation

a. Changing directory – cd

Command: cd <directory path>

Example: cd my_directory

This command will navigate to "my_directory".

b. Showing the current directory – pwd

Command: pwd

Example: pwd

This command will show the path of the current working directory.

c. Going up one level – cd ..

Command: cd ..

This command will take you one level up from the current directory.

Commands to view file and directory information in Hindi |  Commands to view file and directory information

a. Showing a directory list – ls

Command: ls

Example: ls

This command shows a list of all files and folders in the current directory.

b. Showing a detailed list – ls -l

Command: ls -l

Example: ls -l

This command shows a detailed list of files and folders, including their permissions, size, and creation date.

c. Showing hidden files – ls -a

Command: ls -a

Example: ls -a

This command also shows hidden files, whose names start with ".".

Commands to copy and move files and directories in Hindi |  Commands to copy and move files and directories

a. Copying a file – cp

Command: cp <source file> <destination>

Example: cp myfile.txt /home/user/backup/

This command will copy the file "myfile.txt" to the "backup" directory.

b. Copying a directory – cp -r

Command: cp -r <source directory> <destination>

Example: cp -r my_directory /home/user/backup/

This command will copy "my_directory" and all its contents to the "backup" directory.

c. Moving a file or directory – mv

Command: mv <source> <destination>

Example: mv myfile.txt /home/user/backup/

This command will move "myfile.txt" to the "backup" directory.

d. Renaming – mv

Command: mv <old name> <new name>

Example: mv oldfile.txt newfile.txt

This command will rename "oldfile.txt" to "newfile.txt".

Commands for file and directory permissions in Hindi | Commands for file and directory permissions

a. Changing the permissions of files and directories – chmod

Command: chmod <permission> <file or directory>

Example: chmod 755 myfile.txt

This command will change the permissions of "myfile.txt" so that the owner has read, write, and execute permissions, and other users have only read and execute permissions.

b. Changing the owner of a file – chown

Command: chown <owner name> <file or directory>

Example: chown user myfile.txt

This command will change the owner of the file "myfile.txt" to "user".

System information and process management commands in Hindi | System information and process management commands

a. Viewing system information – uname

Command: uname -a

This command displays all information about the system, such as the kernel version, system name, and architecture.

b. Viewing system memory information – free

Command: free -h

This command gives information about the available and used RAM in the system.

c. Viewing running processes – ps

Command: ps -aux

This command shows a list of all currently running processes.

d. Killing a process – kill

Command: kill <pid>

Example: kill 1234

This command will kill the process with PID (Process ID) 1234.

e. Shutting down the system – shutdown

Command: sudo shutdown now

This command will immediately shut down the system.

Networking and Internet related commands in Hindi | Networking and Internet related commands

a. Viewing IP address – ifconfig

Command: ifconfig

This command shows the information and IP address of the network interface.

b. Pinging a host – ping

Command: ping <host name or IP>

Example: ping google.com

  • This command pings the host and checks the status of the network connection.
  • These are some of the main Linux commands that will help you in file and directory management, getting system information, and checking network connection.


Most Important Commands in Linux in Hindi | Most Important Commands in Linux in Hindi:


Files & Navigation

  • ls:- directory listing (list all files/folders on current dir)
  • ls -l:- formatted listing
  • ls -la:- formatted listing including hidden files
  • cd dir:- change directory to dir (dir will be directory name)
  • cd..:- change to parent directory
  • cd../dir:- change to dir in parent directory
  • cd:- change to home directory
  • pwd:- show current directory
  • mkdir dir - create a directory dir
  • rm file: delete file
  • rm -f file:- force remove file
  • rm -r dir:- delete directory dir
  • rm-rf dir:- remove directory dir
  • cp file1 file2 :- copy file1 to file2
  • mv file1 file2 :- rename file1 to file2
  • mv file1 dir/file2:- move file1 to dir as file2
  • touch file: create or update file
  • cat file :- output contents of file
  • cat > file :- write standard input into file
  • cat >> file : append standard input into file
  • tail -f file :- output contents of file as it grows

Networking

  • ping host:- ping host
  • whois domain :- get whois for domain
  • dig domain :- get DNS for domain
  • dig -x host:- reverse lookup host
  • wget file:- download file
  • wget -c file: continue stopped download
  • wget -r url:- recursively download files from url
  • curl url :- outputs the webpage from url
  • curl -o meh.html url:- writes the page to meh.html
  • ssh user@host:- connect to host as user
  • ssh -p port user@host:- connect using port
  • ssh -D port user@host:- connect & use bind port

Processes

  • ps :- display currently active processes
  • ps aux:- detailed outputs
  • kill pid:- kill process with process id (pid)
  • killall proc :- kill all processes named proc

System Info

  • date :- show current date/time
  • uptime:- show uptime
  • whoami :- who you're logged in as
  • w:- display who is online
  • cat /proc/cpuinfo:- display cpu info
  • cat /proc/meminfo:- memory info
  • free:- show memory and swap usage
  • du:- show directory space usage
  • du -sh:- displays readable sizes in GB
  • df:- show disk usage
  • uname -a: show kernel config

Archive & compress

  • tar cf file.tar files :- tar files into file.tar
  • tar xf file.tar: untar into current directory
  • tar tf file.tar:- show contents of archive

Options:-

  • c - create archive
  • t - table of contents
  • x - extract
  • z - use zip/gzip
  • f - specify filename
  • j - bzip2 compression
  • w - ask for confirmation
  • k - do not overwrite
  • T - files from file
  • v - verbose

Permissions

  • chmod octal file - change permissions of file
  • 4 - read (r)
  • 2 - write (w)
  • 1 - execute (x)
  • order: owner/group/world
  • chmod 777:- rwx for everyone
  • chmod 755:- rw for owner, rx for group/world

Other Commands

  • grep pattern files:- search in files for pattern
  • grep -r pattern dir:- search for pattern recursively in dir
  • locate file :- find all instances of file
  • whereis app :- show possible locations of app
  • man command:- show manual page for command

In this Chapter

Linux Commands
Distributed System in Operating System
Real-Time System in Operating System
System Calls in Operating System
System Programs in Operating System
Structure of an Operating System
Layered Design of an Operating System Structure
UNIX in Operating System
Virtual Machine in Operating System
Kernel-Based Operating System
Process Concept in Operating System
Interacting Processes in Operating System
Threads in Operating System
Fundamentals of Scheduling in Operating System
Scheduling Criteria in Operating System
Long, Medium, and Short-Term Scheduling
Scheduling Algorithms in Operating System
Structure of a Concurrent System
Critical Region in Operating System
Critical Section in Operating System
Inter-process Communication (IPC) in Operating System
Monitors in Operating System
Semaphores in Operating System
Semaphore Implementation & Uses in Operating System
Logical and Physical Address in Operating System
Swapping in Operating System
Contiguous Allocation in Operating System
Segmentation in Operating System
Paging in Operating System
Virtual Memory using Segmentation in Operating System
Interprocess Communication Protocol in Operating System
Network Operating System
Design Issues in Distributed File System
Network Structure in Operating System
Structure of a Distributed System
File System and Coordination in Operating System
History of Linux in Operating System
Programmer Interface & File Manipulation in Linux
Process Control in Linux
Kernel & Signals in Linux
File System in Linux
Blocks and Inodes in Linux
System Editors in Linux
Character Transliteration in Linux
The `ed` Line Editor in Linux
The `vi` Editor and Its Commands
Shell Scripting in Linux
Looping & Decision Making in Linux Shell Scripting
Variables & File Name Expansion in Linux
Arrays in Linux Shell Scripting
Subprograms (Functions) in Linux Shell Scripting
C Interface with Linux
Simple Shell Programs in Linux
BCA Part-1 | Operating Systems | Semester-I | MDSU Exam Paper 2023 (Held in 2024)
What is an Operating System (OS)
Operating System (OS) All Important Questions and Answers in English (MDSU)
BCA || Operating System 2025 Paper || MDSU Exam Paper
BCA | OS(Operating System) 2023 Paper | MDSU Exam Paper
Types of Operating Systems
Goals of an Operating System
Operations of an Operating System
Resource Allocation & Functions in an Operating System
Classes of Operating System
Batch Processing in Operating System
Multiprocessing in Operating System
Time-Sharing in Operating System