Palak Infotech Computer Institute | लिनक्स का परिचय एवं 20 महत्वपूर्ण Commands
Linux is a free and open-source operating system. It manages the hardware and software of a computer and lets you work through a GUI (graphical interface) or a CLI (command-line interface, where you type commands).
| Feature | Meaning | Hindi |
|---|---|---|
| Open Source | Source code can be used, studied, and modified | ओपन सोर्स |
| Multiuser | Many users can use one system | मल्टीयूज़र |
| Multitasking | Several programs run at the same time | मल्टीटास्किंग |
| Secure | Permissions and access control protect files | सुरक्षा |
| Portable | Runs on many kinds of hardware | पोर्टेबल |
| Stable | Reliable for long-running servers | स्थिर |
| CLI | Tasks are done by typing commands | कमांड लाइन |
Ubuntu, Debian, Fedora, Red Hat Enterprise Linux (RHEL), Kali Linux (security testing), Linux Mint (beginner-friendly desktop), Rocky Linux (RHEL-compatible server OS).
Note: All distros share the same Linux kernel. They differ in package managers, default software, and desktop environments.
A command is an instruction typed into the terminal to do a task. The general structure is:
command [options/flags] [arguments]
Example: cp -r notes/ backup/ means command cp, flag -r, source notes/, destination backup/.
- (short) or -- (long), e.g. ls -l or ls --all.man <command> or <command> --help to see the options.Practice in a practice folder, not in important directories.
| # | Command | Hindi | Purpose | Example | Useful flags |
|---|---|---|---|---|---|
| 1 | pwd |
वर्तमान पाथ | Print the full path of the current directory | pwd |
none needed |
| 2 | ls |
सूची | List files and folders | ls |
-l details, -a hidden files, -la both |
| 3 | cd |
डायरेक्टरी बदलें | Change directory | cd Documents |
cd alone goes to home, cd - goes back to previous |
| 4 | cd .. |
ऊपर जाएँ | Go to parent directory | cd .. |
cd ../.. goes up two levels |
| 5 | mkdir |
फोल्डर बनाएँ | Make a directory | mkdir students |
-p creates nested folders: mkdir -p a/b/c |
| 6 | touch |
फाइल बनाएँ | Create an empty file, or update its timestamp if it exists | touch notes.txt |
touch a.txt b.txt makes several |
| 7 | cat |
देखें | Display file contents | cat notes.txt |
cat -n shows line numbers |
| 8 | cp |
कॉपी करें | Copy a file | cp notes.txt backup.txt |
-r for folders: cp -r src/ dest/ |
| 9 | mv |
नाम बदलें / ले जाएँ | Rename or move | mv notes.txt linux.txt |
mv file.txt folder/ moves it |
| 10 | rm |
हटाएँ | Delete a file permanently | rm linux.txt |
-r for folders, -i asks before each delete |
| 11 | rmdir |
खाली फोल्डर हटाएँ | Remove an empty directory | rmdir students |
none needed |
| 12 | whoami |
यूज़र नाम | Show the current username | whoami |
none needed |
| 13 | who |
लॉगिन यूज़र | Show users currently logged in | who |
w gives more detail |
| 14 | date |
तारीख और समय | Show system date and time | date |
date "+%d-%m-%Y" formats it |
| 15 | uname |
सिस्टम जानकारी | Show kernel name | uname -a |
-r shows kernel version |
| 16 | df |
डिस्क स्पेस | Show disk space per filesystem | df -h |
-h = human-readable sizes |
| 17 | du |
फोल्डर का आकार | Show size of a folder | du -sh students |
-s summary, -h readable |
| 18 | clear |
स्क्रीन साफ | Clear the terminal screen | clear |
shortcut Ctrl + L |
| 19 | man |
मैनुअल | Open the manual for a command | man ls |
press q to quit |
| 20 | echo |
टेक्स्ट दिखाएँ | Print text | echo "Welcome to Linux" |
echo "text" > file writes to a file, >> appends |
cat with redirection: echo "Hello" > file.txt overwrites the file. echo "Hello" >> file.txt adds to the end. This matters in the practice exercise.cp and mv on folders: cp needs -r. mv works on folders without a flag.rm on folders: rm -r folder deletes a folder and everything in it. Add -i if you are unsure.rm -rf deletes without any confirmation. Never run it on a path you have not checked with pwd and ls first.rmdir vs rm -r: rmdir refuses to delete a folder that still has files.du vs df: du measures one folder's size. df reports the free and used space of whole disks.Type these one at a time and check the output of each.
pwd # where am I?
ls # what is here?
mkdir linux_practice # make a folder
cd linux_practice # go into it
touch file1.txt file2.txt # make two empty files
ls # confirm they exist
cp file1.txt backup.txt # copy file1 to backup
mv file2.txt student.txt # rename file2
ls # check the changes
cat file1.txt # file is empty, so nothing shows
echo "My first Linux class" > file1.txt # write text (overwrites)
cat file1.txt # now the text shows
whoami # who am I?
date # what time is it?
uname -a # system details
cd .. # back to the parent folder
Learning outcomes: create folders and files, list contents, copy and rename, write and read text, and check system information.
Challenge: Run cd linux_practice and then rm -r linux_practice from the parent folder. Before doing so, predict what ls will show.
ls works, LS does not. Notes.txt and notes.txt are different files.clear).rm, sudo (runs as administrator), and commands copied from the internet. Read a command before you press Enter.rm usually cannot be recovered.cd "My Folder" or cd My\ Folder.-r when copying or deleting a folder.> when you meant >>, which wipes the file.rm with a wildcard (*) in the wrong folder.rmdir a folder that still has files.sudo on commands you do not understand.cp and mv?Palak Infotech Computer Institute: Learn. Skill. Succeed.