10 most usefull begginer linux command
लिनक्स कमांड लाइन पर काम करते समय, भ्रमित होना आसान होता है, जिसके विनाशकारी परिणाम हो सकते हैं। यह महसूस करने से पहले कि मैंने अपने कंप्यूटर की बूट निर्देशिका को स्थानांतरित कर दिया है, मैंने एक बार एक रिमूव कमांड जारी किया था। मैंने यह जानने के लिए pwd कमांड का उपयोग करना सीखा कि मैं फ़ाइल सिस्टम के किस हिस्से में था (और इन दिनों, ट्रैशी और ट्रैश-क्ली जैसे कमांड प्रोजेक्ट हैं, जो फ़ाइलों को हटाते समय मध्यवर्ती के रूप में काम करते हैं)।
जब मैं लिनक्स में नया था, तो मेरे पास एक चीट शीट थी जो मेरे डेस्क पर लटकी हुई थी ताकि मुझे अपने लिनक्स सर्वर को प्रबंधित करते समय उन आदेशों को याद रखने में मदद मिल सके। इसे लिनक्स चीट शीट के लिए 101 कमांड कहा जाता था। जैसे-जैसे मैं इन कमांडों से अधिक परिचित होता गया, मैं सर्वर प्रशासन में और अधिक कुशल होता गया।
यहां 10 लिनक्स कमांड हैं जो मुझे सबसे उपयोगी लगते हैं।
1- Make directory (mkdir)
Making directories is easy with the mkdir
command. The following command creates a directory called example
unless example
already exists:
$ mkdir example
You can make directories within directories:
$ mkdir -p example/one/two
2. List (ls)
Coming from MS-DOS, I was used to listing files with the dir
command. I don't recall working on Linux at the time, although today, dir
is in the GNU Core Utilities package. Most people use the ls
command to display the files, along with all their properties, are in a directory. The ls
command has many options, including -l
to view a long listing of files, displaying the file owner and permissions.
3. Copy a file (cp)
Copy files with the cp
command. The syntax is copy from-here to-there. Here's an example:
$ cp file1.txt newfile1.txt
You can copy entire directories, too:
$ cp -r dir1 newdirectory
4. Change directory (cd)
It is often necessary to change directories. That's the cd
command's function. For instance, this example takes you from your home directory into the Documents
directory:
$ cd Documents
You can quickly change to your home directory with cd ~
or just cd
on most systems. You can use cd ..
to move up a level.
5. Create an empty file (touch)
Easily create an empty file with the touch
command:
$ touch one.txt
$ touch two.txt
$ touch three.md
6. Shut down (poweroff)
The poweroff
command does exactly what it sounds like: it powers your computer down. It requires sudo
to succeed.
There are actually many ways to shut down your computer and some variations on the process. For instance, the shutdown
command allows you to power down your computer after an arbitrary amount of time, such as 60 seconds:
$ sudo shutdown -h 60
Or immediately:
$ sudo shutdown -h now
You can also restart your computer with sudo shutdown -r now
or just reboot
.
7. Change permissions (chmod)
Change the permissions of a file with the chmod
command. One of the most common uses of chmod
is making a file executable:
$ chmod +x myfile
This example is how you give a file permission to be executed as a command. This is particularly handy for scripts. Try this simple exercise:
$ echo 'echo Hello $USER' > hello.sh
$ chmod +x hello.sh
$ ./hello.sh
Hello, Don
8. Remove a file (rm)
Removing files is inherently dangerous. Traditionally, the Linux terminal has no Trash or Bin like the desktop does, so many terminal users have the bad habit of permanently removing data they believe they no longer need. There's no "un-remove" command, though, so this habit can be problematic should you accidentally delete a directory containing important data.
A Linux system provides rm
and shred
for data removal. To delete file example.txt
, type the following:
$ rm example.txt
9. Print working directory (pwd)
The pwd
command prints your working directory. In other words, it outputs the path of the directory you are currently working in. There are two options: --logical
to display your location with any symlinks and --physical
to display your location after resolving any symlinks.
10. Escalate privileges (sudo)
While administering your system, it may be necessary to act as the super user (also called root). This is where the sudo
(or super user do) command comes in. Assuming you're trying to do something that your computer alerts you that only an administrator (or root) user can do, just preface it with the command sudo
:
$ touch /etc/os-release && echo "Success"
touch: cannot touch '/etc/os-release': Permission denied
$ sudo touch /etc/os-release && echo "Success"
Success
टिप्पणियाँ
एक टिप्पणी भेजें