0% found this document useful (0 votes)
194 views10 pages

Comandos Linux PDF

The document summarizes key directory mappings, user account configuration files, and common commands for several Unix/Linux systems including AIX, FreeBSD, HP-UX, Red Hat Linux, Solaris, and Tru64. It provides information on where important files and directories are located, how to manage users and groups, perform system monitoring, manage printers, and more. Key commands are listed for tasks like viewing users, modifying accounts, checking performance and errors, starting and stopping services, and more.

Uploaded by

irw3264
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
194 views10 pages

Comandos Linux PDF

The document summarizes key directory mappings, user account configuration files, and common commands for several Unix/Linux systems including AIX, FreeBSD, HP-UX, Red Hat Linux, Solaris, and Tru64. It provides information on where important files and directories are located, how to manage users and groups, perform system monitoring, manage printers, and more. Key commands are listed for tasks like viewing users, modifying accounts, checking performance and errors, starting and stopping services, and more.

Uploaded by

irw3264
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Comandos Unix (FreeBSD, AIX, Linux RedHat, Solaris, HP-UX, Tru64)

lunes 24 de marzo de 2008

Directory AIX FreeBSD HP-UX LINUX(RedHat) SOLARIS Tru64


Mappings
Root filesystem / {/dev/hd4} / {/dev/ad0s1a} / {/dev/vg00/lvol1} / {/dev/sda1} / {/dev/vx/dsk/rootvol} / {/dev/rz0a}
/export/home
Home Directory /home {/dev/hd1} /home {/dev/vg00/lvol4} /dev/vx/dsk/home}
/tmp {/dev/hd3} /tmp {/dev/vg00/lvol6} /tmp
/usr {/dev/hd2} /usr {/dev/ad0s1f} /usr {/dev/vg00/lvol7} /usr /usr {/dev/rz0g}
/var {/dev/hd9var} /var {/dev/ad0s1e} /var {/dev/vg00/lvol8} /var
Sample
configuration /usr/newconfig
Files

User Accounts AIX FreeBSD HP-UX LINUX(RedHat) Solaris Tru64

Password files /etc/passwd /etc/passwd /etc/passwd /etc/passwd /etc/passwd /etc/passwd


/etc/security/passwd /etc/master.passwd /tcb/files/auth/r/root /etc/shadow /etc/shadow
/etc/group /etc/group
Groups file /etc/security/group /etc/group /etc/logingroup /etc/group /etc/group /etc/group
Maximum # of user 4294967295 65535 2147483647 65535 2147483647 65535
Allow/Deny remote /etc/security/user /etc/ttys /etc/securetty /etc/securetty /etc/default/login /etc/securettys
login {rlogin=true} {secure} {console} {ttyp1} {CONSOLE=/dev/consol {ttyp1}
e}
User nobody's id # 4294967294 65534 -2 99 60001 & 65534
Group nobody's id # 4294967294 65534 -2(nogroup) 99 60002 & 65534
{lilo}
control-x
linux S
boot from CD/Tape boot cdrom -s press the HALT Button
>boot passwd root
Installation/Maintenance ok boot -s mkdir /tmp/a or
Recover root Interact with IPL ? Y
Start Limited Shell {grub} mount /dev/c0t0d0s0 (Control-P)
password passwd root ISL>hpux -iS >>>boot -fl s
getrootfs hdisk0 c /tmp/a
passwd root lsmbstartup
vi /etc/security/passwd kernel vmlinuz-2.4.9-13 single vi /tmp/a/etc/shadow
ro root=/dev/hda8 /sbin/bcheckrc
initrd /initrd-2.4.9-13.img passwd root
boot
passwd root

www.linuxsc.net = www.linuxsc.org
Comandos Unix (FreeBSD, AIX, Linux RedHat, Solaris, HP-UX, Tru64)
lunes 24 de marzo de 2008

Create new user Mauser adduser useradd useradd useradd useradd


Delete user Rmuser rmuser userdel userdel userdel userdel
List users lsuser -f ALL logins logins
Modify user account chuser –a usermod usermod usermod usermod

General AIX FreeBSD HP-UX LINUX(RedHat) Solaris Tru64


Commands

Unique host ID Hostid uname -i hostid hostid hostid

Administrator Smit sam linuxconf admintool


Top top
Performance monitor top glance top top top
System activity
reporter Sar sa sar sar {sysstat} sar /usr/opt/svr4/bin/sar
Virtual Memory
statistics Vmstat vmstat vmstat vmstat vmstat vmstat
I/O statistics Iostat iostat iostat iostat {sysstat} iostat iostat
alog -o -t boot
Error logs errpt dmesg dmesg dmesg dmesg uerf -R -o full
Physical RAM 1TB 4TB 64 GB {>2.3.24} 16TB 4TB
Shared Memory 2.75GB 8TB sysctl kernel.shmmax
Process Data Space 2GB 4GB 900 MB
Swap device /dev/hd6 /dev/ad0s1b /dev/vg00/lvol2 /dev/sda2 /dev/vx/dsk/swapvol /dev/rz0b
Swap file type /etc/swapspaces swap swap partition type 82 swap raw
Display swap size lsps –a swapinfo swapinfo -a free swap -l swapon -s
Activate Swap swapon –a swapon -a swapon -a swapon -a swap -a swapon -a

Printers AIX FreeBSD HP-UX LINUX Solaris Tru64


Printer Queues /etc/qconfig /var/spool/print /etc/lp/interface/* /var/spool/lpd/lp/* /etc/lp/interfaces/* /usr/spool/lpd
Stop LP stopsrc -s lpd lpshut /etc/init.d/lpd stop /usr/lib/lp/lpshut /sbin/init.d/lpd stop
Start LP startsrc -s lpd lpd lpsched /etc/init.d/lpd start /usr/lib/lp/lpsched /sbin/init.d/lpd start

www.linuxsc.net = www.linuxsc.org
Comandos Unix (FreeBSD, AIX, Linux RedHat, Solaris, HP-UX, Tru64)
lunes 24 de marzo de 2008

enq
Submit print jobs lp lp lp lpr lp lp
lpr lpr lpr
enq -A
LP statistics lpq lpq lpstat lpq lpstat lpstat
lpstat
cancel
Remove print jobs lprm cancel cancel lprm cancel cancel
qcan lprm lprm lprm

Add printer queue smit mkpq lpadmin -p pq printtool lpadmin -p pq lprsetup


Remove Printer smit rmpq lpadmin -x pq lpadmin -x pq lprsetup
Make default printer export LPDEST="pq" lpadmin -d pq lpadmin -d pq export PRINTER="lp"

TCP/IP AIX HP-UX LINUX(RedHat) Solaris Tru64


/etc/hostname.*
Network IP lsattr -E -l inet0 /etc/rc.conf /etc/rc.config.d/netconf /etc/sysconfig/network-scripts/ /etc/inet/* /etc/rc.config
configuration /etc/defaultrouter
Hosts IP addresses /etc/hosts /etc/hosts /etc/hosts /etc/hosts /etc/inet/hosts /etc/hosts
Name service /etc/netsvc.conf /etc/host.conf /etc/nsswitch.conf /etc/nsswitch.conf /etc/nsswitch.conf /etc/svc.conf
Network parameters no -a Sysctl ndd -h sysctl -a | grep net ndd /dev/[tcp|ip] ?
Routing daemon gated Routed gated routed in.routed routed
NIC Configurations ifconfig -a ifconfig -a lanscan -v ifconfig -a ifconfig -a ifconfig -a
modprobe ip_alias
Secondary IP ifconfig en0 alias IP ifconfig xl0 alias IP ifconfig lan0:1 IP ifconfig eth0:1 IP ifconfig hme0:1 IP up ifconfig ln0 alias
HERALD @ BANNER @
Login prompt /etc/security/login.cfg telnetd -b /etc/issue /etc/issue /etc/default/telnetd /etc/issue

www.linuxsc.net = www.linuxsc.org
Comandos Unix (FreeBSD, AIX, Linux RedHat, Solaris, HP-UX, Tru64)
lunes 24 de marzo de 2008

odmget -q
"attribute=num rebuild your kernel with these {/etc/system}
and new values NPTY=# set pt_cnt = # {SYSV}
uniquetype=pty/pty/pty" NSTRPY=# set npty = # {BSD}
Increase the # of PdAt | sed "s/0-64/0- cd /dev cd /dev
pseudo-terminals 512/" reboot ./MAKEDEV -v pty {/etc/iu.ap} ./MAKEDEV PTY_1
| ptsl 0 # ldterm ttcompat
odmchange -q insf -d ptys -n #
"attribute=num and insf -d ptym -n # halt
uniquetype=pty/pty/pty" insf -d pts -s # -e -v boot -r
-o PdAt

176 {BSD}
Maximum # of ptys 512 {MAXUSERS} 256 3000 {SYSV} 8192
remsh
Remote Shell Rsh remsh rsh rsh rsh
rsh
YP/NIS service
binder /usr/lib/netsvc/yp/ypbind /usr/sbin/ypbind /usr/lib/netsvc/yp/ypbind /sbin/ypbind /usr/lib/netsvc/yp/ypbind /usr/sbin/ypbind

System Files AIX FreeBSD HP-UX LINUX(RedHat) Solaris Tru64


/etc/dfs/dfstab
NFS exported /etc/exports /etc/exports /etc/exports /etc/exports /etc/dfs/sharetab /etc/exports
NFS Client mounted
directories /etc/xtab /etc/xtab /var/lib/nfs/xtab /etc/rmtab /var/adm/mountdtab
128 GB {<= 3.2G}
Max File System 128 GB 128 GB 2 TB 1 TB 512 GB {>= 4.0}
8000 TB {vxfs} 16 TB {advfs}
128 GB {<= 3.2G}
Max File Size 64 GB 128 GB 2 GB {512B block size} 1 TB 512 GB {>= 4.0}
8192 GB {8KB block size} 2 GB {= 16 TB {advfs}

Max # File 64 K 60~ K sysctl fs.file-max 64 K 64 K


Descriptors

DISK/LVM AIX FreeBSD HP-UX:Disk &Filesystem LINUX(RedHat) SOLARIS Tru64


Commands
Filesystem table /etc/filesystems /etc/fstab /etc/fstab /etc/fstab /etc/vfstab /etc/fstab
Free disk blocks df -k df -k bdf df -k df -k df -k

www.linuxsc.net = www.linuxsc.org
Comandos Unix (FreeBSD, AIX, Linux RedHat, Solaris, HP-UX, Tru64)
lunes 24 de marzo de 2008

Device listing lsdev -C /sbin/ioscan cat /proc/devices sysdef


format -d c#t#d#
Disk information bootinfo -s hdisk# fdisk -v ad0 diskinfo /dev/rdsk/c#t#d# cat /proc/scsi/scsi0/sda/model format>current file /dev/rrz0c
f t i i
Disk Label lspv -l hdisk# disklabel ad0 pvdisplay -v /dev/dsk/C#t#d# fdisk -l prtvtoc disklabel -p rz0
LVM Concepts Partition sub disk logical extents logical extents sub disk sub disk
Volume Volume logical volume logical volume Volume Volume
Plex Plex Plex
Volume group volume group volume group disk group disk group
Journal Filesystem
Type jfs vxfs ext2 vxfs advfs
Default volume /dev/rootvg /dev/vg00 /dev/vx/dsk/rootdg /dev/vol/rootdg
group

Display volume lsvg -l rootvg vgdisplay -v vg00 vgdisplay -v vxprint -l -g rootdg volprint -l -g rootdg
group
Modify physical
volume chpv pvchange pvchange
Prepare physical
Disk mkdev -c disk -l hdisk# pvcreate pvcreate vxdiskadd voldiskadd
List physical volume lspv vinum ld pvdisplay pvdisplay vxprint -dl volprint -dl
Remove disk from
volume group reducevg vgreduce vgreduce vxdg rmdisk voldg rmdisk
Move logical
volumes migratepv vinum move -f drive pvmove pvmove vxassist move volassist move
to another physical object
l
Create volume mkvg vgcreate vgcreate vxdg init voldg init
Remove volume vgremove vgremove
chvg
Volume group varyonvg vgchange vgchange
availability varyoffvg
Restore volume vgcfgrestore vgcfgrestore
Exports volume exportvg vgexport vgexport vxdg deport voldg deport
Imports volume importvg vgimport vgimport vxdg import voldg import
Volume group listing lsvg vgscan vgscan

www.linuxsc.net = www.linuxsc.org
Comandos Unix (FreeBSD, AIX, Linux RedHat, Solaris, HP-UX, Tru64)
lunes 24 de marzo de 2008

Change logical
volume chlv lvchange lvchange vxedit set voledit set
characteristics
List logical volume lslv vinum lv lvdisplay lvdisplay vxprint -vl volprint -vl
Make logical volume mklv lvcreate lvcreate vxassist make volassist make
Extend logical
volume extendlv lvextend lvextend vxassist growto volassist growto
Reduce logical AIX reduce LV lvreduce lvreduce vxassist shrinkto volassist shrinkto
volume
Remove logical voledit -g rootdg -rf rm
rmlv vinum rm vol lvremove lvremove vxedit rm
volume vol1
Prepare boot bootlist -m normal lvlnboot lilo vxbootsetup
Remove boot lvrmboot

Extend File system chfs -a size=# /mt extendfs /dev/vg00/lvol8 resize2fs vxva
fsadm -F vxfs -b {LE * 1024} /mt mkfs -M

Reduce/Split mirrors rmlvcopy lvsplit lvsplit


Merge mirrors lvmerge lvmerge

Create mirrors mklv -c 2 vinum mirror drive lvcreate -m 1 vxassist mirror volassist make vol
100mb
i t
Add mirrors mklvcopy lv 2 lvextend -m 1
Create striped vxassist make vol volassist make vol
volumes mklv -u 3 -S 64K vinum stripe drive lvcreate -i 3 -I 64 lvcreate -i 3 -I 64 100mb 100mb
System recovery mksysb -i /dev/rmt0 /opt/ignite/bin/make_recovery /usr/sys/bin/btcreate
tape
Backup savevg -i rootvg vinum saveconfig fbackup tar cvf /dev/rst0 / ufsdump vdump
Restore restvg frecover tar xvf /dev/rst0 ufsrestore vrestore

MISC AIX FreeBSD HP-UX LINUX(RedHat) SOLARIS Tru64


Startup script /etc/rc /etc/rc /sbin/rc /etc/rc.d/rc /sbin/init.d /sbin/init.d
Kernel /usr/lib/boot/unix_up /kernel /stand/vmunix /boot/vmlinuz /kernel/genunix /vmunix
sysdef
sysconfig
Kernel Parameters lsattr -E -l sys0 sysctl -a kmtune sysctl -a sysdef -i
dxkerneltuner
kmsystem

www.linuxsc.net = www.linuxsc.org
Comandos Unix (FreeBSD, AIX, Linux RedHat, Solaris, HP-UX, Tru64)
lunes 24 de marzo de 2008

cd /usr/src/linux
make mrproper
cd /stand/build make menuconfig
/usr/lbin/sysadm/system_prep - make dep
cd /sys/i386/conf v make clean
vi KERNEL -s system make bzimage
Reconfigure the config KERNEL vi /etc/system doconfig
chdev -l sys0 -a vi system make install
kernel cd reboot
mk_kernel -s system make modules
../../compile/KERNEL cd /stand
make modules_install
make depend mv system system.prev
make mv vmunix vmunix.prev cp arch/i386/boot/bzImage
make install mv dlkm dlkm.prev /boot/vmlinuz-2.2.16
mv /stand/build/system system mkinitrd /boot/initrd-2.2.16.img
kmupdate 2.2.16
/stand/build/vmunix_test vi /etc/lilo.conf
lilo

List modules genkex kldstat kmadmin -s lsmod modinfo


Load module kldload kmadmin -L insmod modload
Unload module kldunload kmadmin -U rmmod modunload
Initialize system install assist /stand/sysinstall set parms initial netconf sys-unconfig netsetup
grep -i Physical
Physical RAM bootinfo -r sysctl hw.physmem /var/adm/syslog/syslog.log free prtconf uerf | grep memory
Kernel Bits bootinfo -k getconf KERNEL_BITS getconf WORD_BIT isainfo -kv 64
Crash utility crash crash adb lcrash crash kdbx
Trace System Calls syscalls truss tusc strace truss trace
uname -m model
Machine model bootinfo -m uname -m uname -m uname -m uname -imp uname -p
OS Level oslevel uname -r uname -r uname -r uname -r sizer -v
Run Level who -r who -r runlevel who -r who -r
Core dump files /var/adm/ras /var/adm/crash /var/crash/`uname -n`

www.linuxsc.net = www.linuxsc.org
Comandos Unix (FreeBSD, AIX, Linux RedHat, Solaris, HP-UX, Tru64)
lunes 24 de marzo de 2008

{lilo}
control-x
linux S
Key on service mode/F4 >boot
Boot single user Boot from CD/Tape ok boot -s Interact with IPL ? Y {grub} ok boot -s >>> boot -fl s
Select Maintenance ISL>hpux -iS c
Limited function Shell kernel vmlinuz-2.4.9-13 single
ro root=/dev/hda8
initrd /initrd-2.4.9-13.img
boot

>boot
Maintenance mode ok boot -as Interact with IPL ? Y ok boot -as
ISL>hpux -lm
Interrupt Key control-B Stop-A control-P
Return to console co ok go

Timezone /etc/environment /etc/localtime /etc/TIMEZONE /etc/sysconfig/clock /etc/TIMEZONE /etc/svid3_tz


Management /etc/profile /etc/default/init timezone

/etc/ntp.conf /etc/rc.conf /etc/rc.config.d/netdaemons /etc/ntp.conf /etc/inet/ntp.conf rcmgr set


NTP Daemon {xntpd_enable="YES"} /sbin/init.d/xntpd
startsrc -s xntpd /etc/rc.d/init.d/xntpd /etc/init.d/xntpd XNTPD CONF YES
/ t / t k

Software AIX HP-UX LINUX(RedHat) SOLARIS Tru64


Install Software installp -a pkg add swinstall rpm -i package pkgadd setld -l
Uninstall software installp -u pkg_delete swremove rpm -e package pkgrm setld -d
List installed
software lslpp -L all pkg_info -a swlist rpm -qa pkginfo setld -i
Verify installed pkginfo -i
software lppchk -v swlist -l fileset -a state rpm -V package pkginfo -p setld -v
List all files lslpp -f fileset pkg_info -L package swlist -l file fileset rpm -ql package pkgchk -l package setld -i package
List installed instfix -i swlist -l patch patchadd -p dupatch -track -type
patches what /stand/vmunix patch

Package owner lslpp -w path swlist -l file | grep path rpm -qf file pkgchk -l -p path
SW Directory /usr/lpp /var/db/pkg /var/adm/sw/ /var/lib/rpm /var/sadm /var/adm/smlogs

www.linuxsc.net = www.linuxsc.org
Comandos Unix (FreeBSD, AIX, Linux RedHat, Solaris, HP-UX, Tru64)
lunes 24 de marzo de 2008

Devices AIX FreeBSD HP-UX LINUX(RedHat) SOLARIS Tru64


Devices /dev /dev /dev /dev /devices /dev
drvconfig
Install devices for cfgmgr -v devlinks scu scan edt
/dev/MAKEDEV insf -e /dev/MAKEDEV disks
attached peripherals scsimgr -scan_all
tapes
ports

Remove device rmdev -l rmsf rem_drv


Device drivers lscfg lsdev prtconf -D
CPU lsdev -Cc processor sysctl hw.model ioscan -fnC processor cat /proc/cpuinfo psrinfo -v psrinfo –v
List Terminal lsdev -Cc tty ioscan -fnC tty pmadm -l
/usr/platform/`uname -
Diagnostics diag pciconf -l stm m`/
sbin/prtdiag
ok test-all
/opt/SUNWvts/bin/sunvt
s

Whole Disk /dev/hdisk# /dev/ad0s1c /dev/dsk/c#t#d0 /dev/sda /dev/c#t#d0s2 /dev/rz0c


CDROM /dev/cd0 /dev/acd0c /dev/dsk/c#t2d0 /dev/cdrom /dev/dsk/c#t6d0s2 /dev/rz3c
CDROM file type cdrfs cd9660 cdfs iso9660 hsfs Cdfs
Rewinding tape /dev/rmt0 /dev/rwt0d /dev/rmt/0m /dev/rst0 { c 9 0} /dev/rmt/0 /dev/rmt0
Non-rewinding tape
drive /dev/rmt0.1 /dev/nrwt0d /dev/rmt/0mn /dev/nrst0 { c 9 128 } /dev/rmt/0n /dev/nrmt0
Floppy drive /dev/rfd0 /dev/fd0 - /dev/fd0 /dev/diskette /dev/fd0c

www.linuxsc.net = www.linuxsc.org
Comandos Unix (FreeBSD, AIX, Linux RedHat, Solaris, HP-UX, Tru64)
lunes 24 de marzo de 2008

Links AIX FreeBSD HP-UX LINUX(RedHat) SOLARIS Tru64


FAQ AIX-FAQ FreeBSD FAQ HP-UX FAQ LINUX FAQ Solaris 2 FAQ Tru64 FAQ

Online Manual AIX 4.3 Books FreeBSD Hand Book HP-UX 11.00 Collection Linux Documentation Project Solaris 7 Documentation Tru64 Documents

Technical Support RS/6000 TechSupport IT Resource Center Red Hat support SunSolve Alpha Systems Support

Phone Number 1-800-CALL-AIX 1-800-633-3600 1-888-REDHAT1 1-800-USA-4SUN


Tru64 Demos,
Free Software Bull FreeBSD Primary Site HP-UX Ports Linux Software Map Sun Freeware Shareware &
Freeware
Certification www.ibm.com education.hp.com RHCE suned.sun.com ASE Information

www.linuxsc.net = www.linuxsc.org

You might also like