Вы находитесь на странице: 1из 10

UNIX BASICS

DOCUMENT HISTORY
Published Date Supersedes
12/9/2021
Table of Contents
TABLE OF CONTENTS 1

OVERVIEW/PURPOSE 1

LIMITATIONS 1

1 TOOLS AND OTHER REQUIREMENTS 1

2 COMMANDS, FILES, AND DIRECTORIES 1

3 EXAMPLES OF USAGE2

REFERENCES: 2

2
Published Date: 12/9/2021 1
Overview/Purpose
This document is intended to provide a user with sufficient Unix skills to perform some of the basic
operational tasks required by a Unix administrator at CSUCO.

Limitations
Currently, this document is limited to Red Hat Linux and Solaris systems.

1 Tools and Other Requirements


Tools Required:

SSH client (Putty or SecureCRT, for example)


Login access to dsview server (https://dsview.calstate.edu/dsview/protected/login.do) in order to connect to
UNIX console sessions.

2 Commands, files, and directories


Commands (Unix):

 cat # Concatenate and print files


 cd # Change directory
 chmod # Change file access permissions
 chown # Change file owner and group
 cp # Copy files and directories
 crontab # Maintain user crontabs (scheduling commands)
 df # Report disk usage
 grep # Pattern matching utility
 id # Print user identity
 ifconfig # Configure/view network interface
 ln # Make links between files
 ls # List directory contents
 man # Unix help pages
 mv # Move/rename files and directories
 netstat # Print network connections, routing tables
 passwd # Change/reset a user’s password
 pwd # Print current working directory
 reboot # Reboot a system
 shutdown # Shutdown/reboot a system
 ssh # SSH client
 su # Run as different user
 top # Display system performance
 uname # Print system information
 vi # Visual editor

2
 visudo # Edit sudoers file

Commands (Solaris specific):

 format # Disk partitioning utility


 pkgadd # Software installation utility
 pkginfo # Display software utility
 pkgrm # Software removal utility
 prtdiag # Display system diagnostic information
 raidctl # Hardware RAID utility (certain h/w only)
 showrev # Show s/w and patch revision information
 svcs # Report on service status (Sol 10 only)
 svcadm # Update/query system services (Sol 10 only)

Commands (RHEL specific):

 chkconfig # Update/query system services


 dmidecode # System hardware information
 fdisk # Disk partitioning utility
 service # Run System V init script
 rpm # RPM package manager
 yum # Package manager

Important text files

 /etc/passwd
 /etc/profile
 /etc/default
 /etc/hosts
 /etc/inittab
 /etc/init.d
 /etc/group
 /etc/nsswitch.conf
 /etc/resolv.conf
 /etc/services
 /etc/shadow
 /etc/vfstab #Solaris
 /etc/fstab #RHEL

Important directories:

 /var/adm
 /var/log
 /etc/inet # Solaris
 /etc/sysconfig/network-scripts #RHEL
 /etc/sysconfig/network #RHEL
 /proc #RHEL & Sol 10

Published Date: 12/9/2021 3


3 Examples of Usage
 On a Red Hat Linux server, check the version of Red Hat

coweumlb01-root:/root> cat /etc/issue


Red Hat Enterprise Linux Server release 5.2 (Tikanga)
Kernel \r on an \m

 On a Sun server, check the version of the Solaris kernel and the so-called “cluster” of the
Solaris Operating Environment

coweuepm01-root:/> uname -a
SunOS coweuepm01 5.10 Generic_137137-09 sun4u sparc SUNW,Sun-Fire-V890
coweuepm01-root:/> cat /var/sadm/system/admin/CLUSTER
CLUSTER=SUNWCXall

Explanation of value returned:

SUNWCrnet    Reduced Networking Core System Support


SUNWCreq     Core System Support
SUNWCuser    End User System Support
SUNWCprog    Developer System Support
SUNWCall     Entire Distribution
SUNWCXall    Entire Distribution plus OEM support

 On a Sun server, check the update version of Solaris (the example below is “Solaris 10,
11/06, Update 3”):

coweudb01a:root:/> cat /etc/release


Solaris 10 11/06 s10s_u3wos_10 SPARC
Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 14 November 2006

 Check your logged in user identification

$ id
uid=118(myee) gid=10(wheel) groups=10(wheel)

 On a Unix server, check your logged in user identification

cd # Change directory
chmod # Change file access permissions
chown # Change file owner and group
cp # Copy files and directories
crontab # Maintain user crontabs (scheduling
commands)
df # Report disk usage
grep # Pattern matching utility

4
ifconfig # Configure/view network interface
ln # Make links between files
ls # List directory contents
man # Unix help pages
mv # Move/rename files and directories
netstat # Print network connections, routing tables

 Change a user password

carina-root:/home/root> passwd esp0601


New Password:
Re-enter new Password:
passwd: password successfully changed for esp0601 #

pwd # Print current working directory


reboot # Reboot a system
shutdown # Shutdown/reboot a system
ssh # SSH client
su # Run as different user
top # Display system performance
vi # Visual editor
visudo # Edit sudoers file

format # Disk partitioning utility


pkgadd # Software installation utility
pkginfo # Display software utility
pkgrm # Software removal utility
prtdiag # Display system diagnostic information
raidctl # Hardware RAID utility (certain h/w only)
showrev # Show s/w and patch revision information
svcs # Report on service status (Sol 10 only)
svcadm # Update/query system services (Sol 10 only)

chkconfig # Update/query system services


fdisk # Disk partitioning utility
service # Run System V init script
rpm # RPM package manager
yum # Package manager

 /etc/passwd
 /etc/profile
 /etc/default
 /etc/hosts
 /etc/inittab
 /etc/init.d
 /etc/group
 /etc/nsswitch.conf

Published Date: 12/9/2021 5


 /etc/resolv.conf
 /etc/services
 /etc/shadow
 /etc/vfstab #Solaris
 /etc/fstab #RHEL

Important directories:

 /var/adm
 /var/log
 /etc/inet # Solaris
 /etc/sysconfig/network-scripts #RHEL
 /etc/sysconfig/network #RHEL
 /proc #RHEL & Sol 10

Mount an ISO image in Solaris

mount -F hsfs -o ro `lofiadm -a /home/myee/sol-10-u9-ga-sparc-dvd.iso` /cdrom

References:
Link to a useful cross reference guide: http://unixguide.net/unixguide.pdf

Вам также может понравиться