نمایش نتایج: از شماره 1 تا 8 , از مجموع 8

موضوع: 10 دستور پرکاربرد لینوکس

  1. #1
    مدیر کل Vahid آواتار ها
    تاریخ عضویت
    Aug 2008
    نوشته ها
    2,724
    تشکر تشکر کرده 
    435
    تشکر تشکر شده 
    6,976
    تشکر شده در
    2,085 پست

    پیش فرض 10 دستور پرکاربرد لینوکس

    Top 10 Useful Linux Commands

    I have compiled some of the most basic linux commands that can be most helpful for linux beginners. You can enter these commands in SSH in administering your server. These commands could be handy to webmasters who are learning VPS or dedicated server basics.
    1. List command

    ls -a
    // lists all
    ls -l
    // lists all files including hidden files like .htaccess
    ls -l | more
    // shows in paged format with pipe
    2. Untarring the uploaded tar.gz files

    This command is the most important command and often regularly used to uncompress files..
    tar -xzf filename.tar.g
    How to dump/Import tar.gz (zipped) file into MySQL database
    SSH command to restore/import gzipped large databases to mysql on the fly with just one single command. This is so useful as large databases can only be imported to mysql this way! Remember to upload the database dump before you issue this command
    gunzip < dbname.gz | mysql -u Username -p dbname
    3. Installing packages

    Installing softwares in linux the most basic and you will need to know this command very well .
    yum install
    // for centos and redhat
    apt-get install
    // for debian/ubuntu
    4. To look for memory usage

    top
    // shows the memory, cpu load and other processes running
    free
    // shows the memory usage of linux
    5. To see the disk usage.

    df -h
    // shows the disk usage and outputs the disk usage left
    6. To view running processes

    ps aux
    // shows the running processes and its ID. You can use this ID to kill the process later.
    7. Deleting all files within a folder

    This perhaps is one of the most sought after command to delete all subfiles and subfolders in linux with just one command in a fly.
    rm -Rf /my/path
    // this deletes all files. so be careful!
    8. Edit a file in easy way!

    I love nano command. Its just so easy to edit a file with menu options and save changes. You can easily search for specific text inside the file with the nano editor.
    nano /file/path
    // text editor to edit files
    9. Changing Permissions and Ownership

    whats there in linux without permissions and ownership
    chmod -R 755 /folder/path
    // this recursively changes all files and folders of the path.
    chown pbu /file/name
    //changes the ownership of filename
    chgrp mygrp /file/name
    //changes the group to new one
    If you dont know how to interpret the 755 or number like permissions here is an easy way to remember
    Ex: 755 means rwxr-xr-x
    7 -> rwx (for owner)
    5 -> r-x (non writable for group)
    5 -> r-x (non writable for world)
    First we consider '7' in 755 as it is made up of 3 bit binary. To construct 7 we need to construct 111(which is 4+2+1 in decimal).
    5 -> 101 ( which is 4+0+1)
    5 -> 101 (which is 4+0+1)
    Remember 755 is the decimal of the binary and it is always made up of 4+2+1.
    10. To find out what ports are open

    Finding which ports are open and closed are so important in terms of security point of your server. You might want to close unwanted services using different ports.
    netstat -nap --tcp
    // lists connections and what ports are open.
    OR
    nmap fuser localhost
    // easy command
    Install firewall to block unwanted ports running on your PC or in server.
    FAQs

    How do i change root password?
    Just login as root or su root and type passwd, you will be asked for new password.
    > passwd
    // Be CAREFUL! If you forget your new password, you will lock yourself
    I am installing a firewall in my linux server? How do i know which ports to block and to open?
    When installing firewall be sure to block all unwanted open ports. A comprehensive collection of ports and services run at that port can be found here
    Here is the short of ports which needs to be kept open for listening.
    Common ports
    21 => FTP
    22 => SSH
    25 => SMTP Mail Transfer
    43 => WHOIS service
    53 => name server (DNS)
    80 => HTTP (Web server)
    110 => POP protocol (for email)
    143 => IMAP Protocol (for email)
    443 => SSL for HTTP

    Cpanel => 2077,2078,2082,2083,2086,2087,2089,2095,2096,3306, 6666.
    Plesk => 8443
    Webmin => 10000
    If you have root permissions, you can login to your server control panel like this...
    https://ipaddress:2087/
    // for cpanel
    https://ipaddress:8443/
    // for plesk
    Hope my ports compilation should be helpful for beginners who use linux.

    برای پیش رفت در علم آسانسوری وجود ندارد پله ها را باید پیاده رفت /./ همیشه این یادتان باشد که دست بالای دست بسیار است.
    يادمان باشد براي يك بار ايستادن صد ها بار افتاده ايم /./ بک آپ مهمترین رمز موفقیت هاستینگ /./ امنیت مطلق نیست.
    ارتباط مستقیم با من :
    Admin -{(@)}- WebHostingTalk . ir

  2. تعداد تشکر ها ازVahid به دلیل پست مفید


  3. # ADS




     

  4. #2
    کاربر اخراج شده
    تاریخ عضویت
    Aug 2008
    محل سکونت
    Tehran
    نوشته ها
    186
    تشکر تشکر کرده 
    48
    تشکر تشکر شده 
    607
    تشکر شده در
    444 پست

    پیش فرض

    فقط درباره nano که باید قبلش نصبش کرد :yum install nano -y

    و هم چنین برای untarکردن هم بهتره بزنی که بتونی ببینی چی داره untar می شه :

    tar -vzxf filename.tar.gz

    برای پاک کردن فولدر ها هم در دستور rm باید option -r استفاده بشه که بتونین حذف کنین

    مرسی وحید

  5. تعداد تشکر ها ازKamranOnline به دلیل پست مفید


  6. #3
    عضو جدید
    تاریخ عضویت
    Dec 2009
    نوشته ها
    30
    تشکر تشکر کرده 
    39
    تشکر تشکر شده 
    11
    تشکر شده در
    7 پست

    پیش فرض پاسخ : 10 دستور پرکاربرد لینوکس

    دستور ریست کردن Mysql رو هم بگین لطفا .

  7. تعداد تشکر ها از B E H N A M به دلیل پست مفید


  8. #4
    عضو انجمن
    تاریخ عضویت
    Dec 2008
    نوشته ها
    363
    تشکر تشکر کرده 
    0
    تشکر تشکر شده 
    611
    تشکر شده در
    373 پست

    پیش فرض پاسخ : 10 دستور پرکاربرد لینوکس

    نقل قول نوشته اصلی توسط B E H N A M نمایش پست ها
    دستور ریست کردن Mysql رو هم بگین لطفا .
    service mysqld restart

  9. تعداد تشکر ها ازgoldstar به دلیل پست مفید


  10. #5
    عضو دائم Arashdn آواتار ها
    تاریخ عضویت
    Sep 2008
    نوشته ها
    1,863
    تشکر تشکر کرده 
    586
    تشکر تشکر شده 
    8,046
    تشکر شده در
    1,382 پست

    پیش فرض پاسخ : 10 دستور پرکاربرد لینوکس

    فقط درباره nano که باید قبلش نصبش کرد :yum install nano -y
    اگه سرور مجازی نباشه خودش nano داره

  11. تعداد تشکر ها از Arashdn به دلیل پست مفید


  12. #6
    عضو انجمن
    تاریخ عضویت
    Apr 2010
    نوشته ها
    129
    تشکر تشکر کرده 
    7
    تشکر تشکر شده 
    86
    تشکر شده در
    81 پست

    پیش فرض پاسخ : 10 دستور پرکاربرد لینوکس

    دستور save یک فایل بعد از edit چیه؟

  13. تعداد تشکر ها از mohammadt به دلیل پست مفید


  14. #7
    عضو انجمن rayannet آواتار ها
    تاریخ عضویت
    Apr 2009
    نوشته ها
    233
    تشکر تشکر کرده 
    275
    تشکر تشکر شده 
    235
    تشکر شده در
    183 پست

    پیش فرض پاسخ : 10 دستور پرکاربرد لینوکس

    نقل قول نوشته اصلی توسط mohammadt نمایش پست ها
    دستور save یک فایل بعد از edit چیه؟
    اگر با nano ویرایش کردید Ctrl + X خارج میشود و بعد از شما سوال میکند که ایا ذخیره شود تغییراتی که انجام دادید یا خیر که با y یا n میتونید جواب بدید
    اگر با vim ویرایش کردید اول Esc بزنید بعد :wq بزنید دخیره و خارج میشود اگر بخواهید فقط خارج شوید و ذخیره نشود میتونید بزنید :q!

  15. تعداد تشکر ها ازrayannet به دلیل پست مفید


  16. #8
    عضو انجمن
    تاریخ عضویت
    Apr 2010
    نوشته ها
    129
    تشکر تشکر کرده 
    7
    تشکر تشکر شده 
    86
    تشکر شده در
    81 پست

    پیش فرض پاسخ : 10 دستور پرکاربرد لینوکس

    با putty ویرایش می کنم!

  17. تعداد تشکر ها از mohammadt به دلیل پست مفید


اطلاعات موضوع

کاربرانی که در حال مشاهده این موضوع هستند

در حال حاضر 1 کاربر در حال مشاهده این موضوع است. (0 کاربران و 1 مهمان ها)

موضوعات مشابه

  1. پاسخ ها: 123
    آخرين نوشته: September 2nd, 2018, 22:20
  2. مشکل در دستور ssh
    توسط rotana007 در انجمن سوالات و مشکلات
    پاسخ ها: 5
    آخرين نوشته: October 31st, 2014, 02:25
  3. یک دستور
    توسط M-Sadeghi در انجمن سوالات و مشکلات
    پاسخ ها: 5
    آخرين نوشته: June 11th, 2014, 10:42
  4. مشکل در رستور کردن
    توسط L0cal در انجمن سوالات و مشکلات
    پاسخ ها: 5
    آخرين نوشته: February 18th, 2012, 22:27

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •