หน้าเว็บ

วันศุกร์ที่ 27 พฤษภาคม พ.ศ. 2554

Howto check services on Solaris 10

ในการดูว่า services อะไรบ้าง กำลัง online ใช้คำสั่ง

#  svcs

หากต้องการดูรายละเอียด ใช้คำสั่ง

# svcs -l <service_name>

หากต้องการ enable service

svcadm enable <service_name

หากต้องการ disable  service 

svcadm disable  <service_name>

หากต้องการ restart service  ใช้คำสั่ง

# svcadm restart <service_name>


Thanks :  www.experts-exchange.com


**command line for check services on solaris 10

วันพฤหัสบดีที่ 26 พฤษภาคม พ.ศ. 2554

Howto exact .tar.gz on solaris 10/ubuntu .




solaris    :  gunzip -c file_name.tar.gz |tar xvf -




ubuntu :  tar -xzvf   file_name.tar.gz



Thanks : www.tek-tips.com

วันอังคารที่ 17 พฤษภาคม พ.ศ. 2554

Howto use basic find command unix/linux.

syntax : find where-to-look criteria what-to-do


ตัวอย่างต่อไปนี้เป็นการใช้คำสั่ง find เพื่อค้นหา file ที่มีชื่อ "Toneation" โดยค้นหาไฟล์ทั้งหมดของระบบ filesystem  ("/')  แล้วโชว์ขึ้นหน้าจอ

find / -name Toneation -type f -print


หรืออาจระบุ directory ที่ต้องการจะค้นหาโดยเฉพาะ เช่น /usr และ /home


find /usr /home -name Toneation -type f


หรือให้ค้นหาเฉพาะ current directory


find . -name Toneation -type f


หรือใช้ค้นหา  ไฟล์ที่มีหลายนามสกุล หรือขึ้นต้นด้วย Toneation เช่น Toneation1,Toneation.txt


find /usr -name "Toneation*" -type f


หรือใช้ค้นหา ไฟล์ที่ลงท้ายด้วยนามสกุลที่ต้องการ

find /usr/local -name "*.html" -type f

 
และกรณีปิด error message ให้เพิ่ม 2>/dev/null  ดังนี้



find / -name "Toneation" 2>/dev/null 
 
 
  
Thanks:  http://www.devdaily.com/  , content.hccfl.edu

วันพุธที่ 11 พฤษภาคม พ.ศ. 2554

Howto add user on Soloris 11.

How to add user on Soloris 11.


  ใช้   useradd เพื่อทำการ สร้าง user ใหม่

useradd -u 1002 -g sysadmin -m -d /home/export/toneation -s /bin/sh toneation
 กรณีมี user อยู่แล้ว ใช้ usermod เพื่อแก้ไขค่าอื่นๆ

usermod -c "Sysadmin" toneation
ทำการตั้งค่ารหัสผ่านด้วย passwd

passwd toneation

Remark :   Red คือ syntax  Blue คือ option
                
 
 
  
 ตัวอย่างการใช้งาน คำสั่ง useradd


ตัวอย่างการใช้งาน คำสั่ง passwd


ผลลัพท์ที่ได้จากการใช้งานคำสั่ง logins
 
usage: useradd [-u uid [-o] | -g group | -G group[[,group]...] |-d dir |
-s shell | -c comment | -m [-k skel_dir] | -f inactive |
-e expire | -A authorization [, authorization ...] |
-P profile [, profile ...] | -R role [, role ...] |
-K key=value | -p project [, project ...]] login
useradd -D [-g group | -b base_dir | -f inactive | -e expire
-A authorization [, authorization ...] |
-P profile [, profile ...] | -R role [, role ...] |
-K key=value ... -p project]
 
Thanks : http://www.unix.com

วันจันทร์ที่ 9 พฤษภาคม พ.ศ. 2554

Howto set DNS Client on Solaris.

DNS Client Setup

แก้ไฟล์  /etc/resolv.conf 

# vi /etc/resolv.conf

Add the following lines to it:

search tot.co.th
nameserver 192.168.1.1

ซึ่ง,
  • nameserver IP :  คือ Primary  DNS server
  • search tot.co.th  : Default domain name to search. For example, if you type command nslookup www, it will search it as www.tot.co.th
Thanks : tech-recipes.com