Linux Basic Commands With Examples In Hindi - Part 1

Blogs ❯❯ Linux

Image could not load

Image on pixabay

Linux का सबसे ज्यादा use , servers में किया जाता है। लगभग 90% internet Linux servers द्वारा संचालित होता है। ऐसा इसलिए है क्योंकि Linux fast, secure और free है। दुनिया के लगभग 80% smartphones में चलने वाला OS, Android भी Linux Kernel से ही बनाया गया है।

Linux shell

So, basically, shell एक program है जो users से command receive करता है और इसे OS को process करने के लिए देता है, और input के according Output दिखाता है। Linux का shell इसका important part है। इस tutorial में, हम उन basic commands के बारे में जानेंगे जिनका use हम Linux shell में करते हैं और हर linux user को पता होनी चाहिए।

# whoami
root
# pwd
/home/ubuntu
# uname --kernel-name
Linux
# uname --operating-system
GNU/Linux

uname

uname command का use , current OS के बारे में information show करने के लिए किया जाता है। by default uname Linux Kernel का name print करता है।

# uname
Linux

learn more about uname comamnd ...

हालाँकि uname के बाद आप option भी pass कर सकते हैं जैसे uname -v का use version पता करने के लिए करते हैं।

# uname -v
#23-Ubuntu SMP Wed Aug 17 18:33:13 UTC 2022

whoami

whoami command का use current username print करने के लिए किया जाता है।

# whoami
root

pwd

pwd command की full form present working directory होता है , इसका use present working directory का name print करने के लिए किया जाता है।

# pwd
/home/ubuntu

ls

ls command का use current directory में मौजूद सभी files और directory को list करने के लिए किया जाता है।

# ls
testfile.txt  testfolder

अगर अगर ls -l लिख देते हैं तो आप files और directory को permissions के साथ list कर सकते हैं। जैसे -

# ls -l
total 4
-rw-r--r-- 1 root root    0 Oct  1 16:44 testfile.txt
drwxr-xr-x 2 root root 4096 Oct  1 16:44 testfolder

cd

cd command का use किसी दूसरी directory में move करने के लिए किया जाता है। जैसे ऊपर image में मेरी current directory में testfolder name से एक folder बना हुआ है , अब अगर मुझे tests को locate करना है तो कुछ इस तरह से करेंगे-

$ cd testfolder
/testfolder$

और वापस आने again एक directory पीछे आने के लिए cd के साथ ../ लिखते हैं।

cd ../

man

man की full form manual होती है, इस command का use किसी command के बारे में जानने के लिए किया जाता है। जैसे आपको uname command के बारे में जनना है -

man uname
NAME
    uname - print system information
SYNOPSIS
    uname [OPTION]...
DESCRIPTION
    Print certain system information.  With no OPTION, same as -s.
    -a, --all
        print all information, in the following order, except omit -p and -i if unknown:
    -s, --kernel-name
        print the kernel name
    -n, --nodename
        print the network node hostname
    -r, --kernel-release
        print the kernel release
    -v, --kernel-version
        print the kernel version
    -m, --machine
        print the machine hardware name
    -p, --processor
        print the processor type (non-portable)
    -i, --hardware-platform
        print the hardware platform (non-portable)
    -o, --operating-system
        print the operating system

man command run करने के बाद आपको q key press करनी पड़ेगी , तब आप वापस normal shell में आ पाएंगे।

history

history command , आपके द्वारा run की गयी सभी commands को print करती है -

history
    1  clear
    2  man cd
    3  man ls
    4  man uname
    5  history

clear

clear command का use , shell screen को clear करने के लिए किया जाता है।

chmod

chmod command का use , सभी users के लिए किसी file की permissions को manage करने के लिए किया जाता है।

learn more about chmod ...

hostname

hostname command का use , किसी network में आपका name जानने के लिए किया जाता है।

whatis

whatis command का use , किसी command को briefly describe करने के लिए जाता है .

// Syntax.
whatis [command]

For Example , नीचे कुछ commands के बारे में जानने के लिए whatis command का use किया गया है।

$ whatis ls
ls (1)               - list directory contents
$ whatis history
history (3readline)  - GNU History Library
$ whatis man
man (1)              - an interface to the system reference manuals
man (7)              - macros to format man pages
$ whatis uname
uname (1)            - print system information

sudo su

sudo su , command का use super user (root) से switch करने किया जाता है। by default आप as a user login होते हैं। अगर आपकी command line पर $ sign दिख रहा है तो आप एक normal user हैं -

$ whoami
ubuntu

sudo su run करने पर आपको $ की जगह # का sign दिखने लगेगा।

$ sudo su
# whoami
root

वापस normal user में switch करने su [username] run करते हैं -

# su ubuntu
$

apt-get

apt-get command का use , किसी package को install करने के लिए किया जाता है। हालाँकि ध्यान रहे इस command को run करने के लिए root privileges / permissions की जरूरत होती है। तो इसलिए हमें sudo prepend करना पड़ेगा।

Suppose , आपको एक simple man package ही download करना है , जिसका use किसी command का manual देखने के लिए किया जाता है।

$ sudo apt-get install man

कोई भी नया package / library install करने से पहले अपनी repository को update रखना हमेशा एक अच्छी practice है , इसलिए package install करने से पहले हमेशा sudo apt-get update command run करके repository update करें।

ping

ping command का use , server से अपना connection check करने के लिए किया जाता है। और Wikipedia के according : ping एक network administration software utility है जिसका use Internet Protocol (IP) Network पर किसी host की reach-ability test करने के लिए किया जाता है।

Example के लिए अगर आप , ping google.com command को ही fire करोगे तो उसका output कुछ इस तरह से आएगा।

$ ping gooogle.com
PING gooogle.com (142.251.16.106) 56(84) bytes of data.
64 bytes from bl-in-f106.1e100.net (142.251.16.106): icmp_seq=1 ttl=50 time=1.67 ms
64 bytes from bl-in-f106.1e100.net (142.251.16.106): icmp_seq=2 ttl=50 time=1.70 ms
64 bytes from bl-in-f106.1e100.net (142.251.16.106): icmp_seq=3 ttl=50 time=1.69 ms
64 bytes from bl-in-f106.1e100.net (142.251.16.106): icmp_seq=4 ttl=50 time=1.68 ms
64 bytes from bl-in-f106.1e100.net (142.251.16.106): icmp_seq=5 ttl=50 time=1.72 ms
64 bytes from bl-in-f106.1e100.net (142.251.16.106): icmp_seq=6 ttl=50 time=1.72 ms
^C
--- gooogle.com ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9012ms
rtt min/avg/max/mdev = 1.666/2.008/4.497/0.836 ms

Linux command Tip :

TAB : TAB का use करके command को fill कर सकते हैं , suppose आप किसी directory में move करना चाहते हैं तो , और आपके directory का name याद नहीं है या उसका name बड़ा है तो simply उसका first letter लिखकर TAB press करके command को fill कर सकते हैं।

exit : exit का use करके current session को logout / exit कर सकते हैं।

I Hope , आपको Linux basic commands के बारे में ये blog पसंद आया होगा।:)

Recent Blogs

Loading ...

Rahul Kumar

Rahul Kumar

Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)

Get connected with me. :) LinkedIn Twitter Instagram Facebook