2014년 10월 17일 금요일

Linux Command



from http://bhami.com/rosetta.html


TASK \ OSLinuxOS / TASK
OS notes(rh) = Red Hat,
Mandrake, SUSE,...
(deb) = Debian, Libranet,...
(fed) = Fedora
(gen) = Gentoo 

(md) = Mandrake/Mandriva
(SUSE) = SUSE
OS notes
administrative GUI(rh, FC2+, RHEL4+) system-config*
(rh) redhat-config*
linuxconf (obsolete)

(SUSE) yast2
(deb)
 dpkg-reconfigure
(md)
 drakconf
administrative GUI
managing usersuseradd
usermod
userdel
adduser
chage
getent
managing users
TASK \ OS LinuxOS / TASK 
list hardware configurationarch
uname
dmesg (if you're lucky)
cat /var/log/dmesg
/proc/*
lshw
dmidecode
lspci
lspnp
lsscsi
lsusb
lsmod
(SUSE) hwinfo
/sys/devices/*
list hardware configuration 
unique id useful for licensing/sbin/ifconfig eth0unique id useful for licensing
show/set
EEPROM/NVRAM
values
/dev/nvram (if you have it)
hwclock
nvsetenv
show/set
EEPROM/NVRAM
values
add device without rebootudev (2.6+)
udevtrigger
modprobe
kerneld
insmod
hotplug
cardctl
add device without reboot
remove device?remove device
tape device/dev/st0tape device
stdin/ stdout/ stderr/dev/fd/[012]stdin/ stdout/ stderr
X kvm configxorgcfg
xorgconfig
Xorg -configure
system-config-display
xf86config
XFree86 -configure
redhat-config-xfree86
/etc/X11/?dm
X kvm config
TASK \ OS LinuxOS / TASK 
read a disk label fdisk -lread a disk label 
whole disk in partition /dev/hda (e.g. if /dev/hda1
is a partition)
whole disk in partition 
label a disk cfdisk
fdisk
gdisk
e2label
label a disk 
partition a disk parted (if you have it)cfdisk
fdisk
gdisk
pdisk (on a MAC)
(deb) 
mac-fdisk (on a MAC)
(md) 
diskdrake
partition a disk 
TASK \ OS LinuxOS / TASK 
kernel/boot/vmlinuz*
/boot/bootlx
(see /etc/lilo.conf or /boot/grub/menu.lst)
kernel
show/set kernel parameters/proc/*
/proc/sys/*
sysctl
/etc/sysctl.conf
show/set kernel parameters
limit physical memorymem= (in lilo.conf or /boot/grub/grub.conf)limit physical memory
loaded kernel moduleslsmodloaded kernel modules
load modulemodprobe
insmod
load module
unload modulermmod
modprobe -r
unload module
make disk bootable(rh) mkbootdisk
(deb) fdisk -A
(and lilo to manipulate mbr)
make disk bootable
startup scripts /etc/rc* (but may vary)
/etc/init.d/
chkconfig
service
startup scripts 
start/ stop/ config services(rh) service
(rh) chkconfig
(deb) sysv-rc-conf
start/ stop/ config services
shutdown (& power off if possible)shutdown -Ph now
shutdown -y -g0 -i0
halt
poweroff
shutdown (& power off if possible)
run levels 1
*=normal states 
for more detail
see

www.phildev.net/runlevels.html
(set in /etc/inittab)
0: halt
s,S,1: vendor-dependent
1: single-user
2-5*: multiuser
6: reboot
run levels 1
*=normal states
for more detail
see

www.phildev.net/runlevels.html
show runlevel 1/sbin/runlevelshow runlevel 1
time zone info/usr/share/zoneinfo/
/etc/localtime
time zone info
check swap space swapon -s
cat /proc/meminfo
cat /proc/swaps
free
check swap space 
core dump management/proc/sys/kernel/core_pattern
/proc/pid/coredump_filter
core dump management
bind process to CPUtaskset (sched-utils)bind process to CPU
TASK \ OS LinuxOS / TASK 
"normal" filesystem ext2
ext3
ReiserFS
"normal" filesystem 
volume-based filesystem LVM, LVM2
EVMS
VxVM ($)
volume-based filesystem 
file system
description
 /etc/fstabfile system
description
volume manipulatione2fsadm
lvcreate
lvremove
lvextend
vgdisplay
volume manipulation
create filesystemmke2fs
mkreiserfs
mkdosfs
mkfs.*
create filesystem
file system debugging and recoveryfsck
debugfs
e2undel
file system debugging and recovery
create non-0-length empty filefallocate
dd if=/dev/zero of=filename
bs=1024k count=desired
create non-0-length empty file
convert DOS-format text to Unix formatdos2unixconvert DOS-format text to Unix format
mount CDROMmount /mnt/cdrom
(deb) mount /cdrom
mount CDROM
eject CDROMejecteject CDROM
create/mount ISO imagemkisofs
mount -o loop pathToIso
mountPoint
create/mount ISO image
ACL managementgetfacl
setfacl
ACL management
Fibre Channel / SANsystool
multipath
Fibre Channel / SAN
TASK \ OS LinuxOS / TASK 
NFS share definitions/etc/exportsNFS share definitions
NFS share command/etc/init.d/nfs-server reload
(rh) 
exportfs -a
NFS share command
NFS informationcat /proc/mountsNFS information
name resolution order/etc/nsswitch.conf
/etc/resolv.conf
name resolution order
show network interface infoifconfig
ethtool
show network interface info
change IPifconfig
(rh)
 redhat-config-network

(fedora) system-config-network
(rh) edit: /etc/hosts,
/etc/sysconfig/network,
/etc/sysconfig/
network-scripts/
ifcfg-eth0
(deb) edit
/etc/network/interfaces;
/etc/init.d/networking
restart
change IP
start DHCP clientdhcpcd
dhclient
start DHCP client
ping one packet  ping -c 1 hostnameping one packet 
sniff networketherfind
tcpdump
wireshark (formerly ethereal)
etherape
sniff network
route definitions route
(rh) 
/etc/sysconfig/network

(rh) /etc/sysconfig/static-routes
(deb) /etc/init.d/network
(deb) /etc/network
route definitions 
telnetd, ftpd banner/etc/issue.net (telnet)
(ftp varies; can use tcp wrappers)
telnetd, ftpd banner
set date/time(from net: ntp or other)ntpdate
rdate
netdate
set date/time(from net: ntp or other)
TASK \ OS LinuxOS / TASK 
auditing(2.6+) auditd
/var/log/faillog
auditing
encrypted passwords in /etc/shadow (may vary)encrypted passwords in 
min password length/etc/pam.d/system-authmin password length
allow/deny root
logins
/etc/securettyallow/deny root
logins
firewall configiptables
ipchains
ipfwadm
(rh) redhat-config-
securitylevel
firewall config
TASK \ OS LinuxOS / TASK 
show installed software (rh) rpm -a -i
(rh) rpm -qa
(rh) yum list installed
(deb) dselect
(deb) aptitude
(deb) dpkg -l
(gen) ls /var/db/pkg/*
(gen) eix -I
show installed software 
file is in which package(deb) dpkg --search file
(deb) apt-file update && apt-file search file
(rh) rpm -qif file
(gen) 
equery b file
(gen) 
qfile file
file is in which package
add software(rh) rpm -hiv
(rh) yum install pkg
(deb) dselect
(deb) apt-get install pkg
(deb) dpkg -i
(md) urpmi
add software
precompiled binaries of GPLware and freewarewww.linux.org
linux.tucows.com
sourceforge.net
rpmfind.net
(deb) ftp.debian.org
(deb) packages.debian.org
(gen)packages.gentoo.org3
(gen)gentoo-portage.com3
(md)easyurpmi.zarb.org
precompiled binaries of GPLware and freeware
C compiler cc
gcc
C compiler 
show patch level
and/or patches
(rh) rpm -q
(rh) cat /proc/version
(rh) cat /etc/redhat-release
(deb) dpkg -s
show patch level
and/or patches
patch tool apt-get update
apt-get upgrade
(rh) up2date
(rh) yum update
(md) urpmi
patch tool 
configure/show
runtime linking
fortran-2000.com/
ArnaudRecipes/
sharedlib.html
ldconfig
ldd
lsmod
configure/show
runtime linking
fortran-2000.com/
ArnaudRecipes/
sharedlib.html
link library path$LD_LIBRARY_PATH
/etc/ld.so.conf
link library path
tracing utility strace
ltrace
tracing utility 
define user defaults/etc/profile
/etc/security/
/etc/skel/
/etc/profile.d/*
define user defaults
csh global .login/etc/csh.logincsh global .login
default syslog and messages/var/log/syslog
/var/log/messages
/usr/adm/messages
/var/log/maillog
default syslog and messages
system error reporting tool dmesg
(deb) reportbug
system error reporting tool 
performance monitoringvmstat
procinfo -D
top
htop
pstree
performance monitoring
match process to file or portlsof
netstat -atup
match process to file or port
manage various logslogrotate
(rh)
sysreport; sosreport
manage various logs
X pop-up/usr/X11R6/bin/xmessageX pop-up
Wikipedia LinuxWikipedia
FAQs (see also faqs.org)www.linuxdoc.org/
FAQ/Linux-FAQ

www.debian.org/doc/
FAQ
FAQs (see also faqs.org)
blogslinuxmoz.comblogs
mailing list www.linumanagers
.org

www.linux.org/
help/lists.html
mailing list 
mailing list archives www.linuxmanagers.org/
pipermail/linuxmanagers

lists.debian.org
mailing list archives 
man pages
www.freebsd.org/
cgi/man.cgi
www.linuxmanpages.com/
Fedora Core 4:
linuxcommand.org/
superman_pages.php

www.tldp.org/docs.html#man
man pages
www.freebsd.org/
cgi/man.cgi
newsgroup(s) and forums
groups.google
comp.os.linux.* (esp .answers)newsgroup(s) and forums
groups.google
user groupswww.debianhelp.orguser groups
magazineswww.linuxjournal.com
www.linux-mag.com
www.debianplanet.org
magazines
vendor home pagewww.linux.org
www.debian.org
gentoo.org
www.redhat.com

(SUSE) www.novell.com/linux
vendor home page
vendor docs and patches (see also man pages)tldp.org
www.linuxdoc.org/
rpmfind.net/linux/RPM
vendor docs and patches (see also man pages)
vendor phone (US)?vendor phone (US)
wikisfedoraproject.org/
wiki/Main_Page
 (fed)

susewiki.org (SUSE)
wikis
TASK / OSLinuxOS \ TASK