Shells

by moodyharsh
shells

shells
sh
csh
tcsh
ksh
zsh
psh
scsh
esh

basic shell commands
chs || sh
#-v for verbose
#-x shows each slice of the process too preceeded by a plus
#-n for parsing out errors
#-e to exit after one error
source
xargs
export setenv
hash, rehash

history

!!
!!:n,!!:^,!!:$,!!:*,
!vi
!?vi
!!:s/

pushd
popd
dirs

alias
unalias
set
unset
limit
wc

echo
read
print
cat
nc

tr
shift
head
tail
sort
uniq
fmt
script
fold
col
roff
expand
colcrt
more

expr
eval
test, [

dc
bc

fstat
umask
newgrp

mktemp

hostname
uname
realpath
basename
dirname
banner
wall
motd
date
calender
times

sed – stream pattern matcher
awk – database pattern matcher
grep– regexp pattern matcher
find– reexp filematcher
mtree

cut
paste
copy
diff
patch
od

{ }, ( )
if [ ] #-f , -d
then
elif
then
else
fi
for i in
do
done
while
do
done
case
)
)
)
esac

break
continue
routine()
{
}
#a function can also returrn a value. else it returns the last most
return value
#all variables are global. local variables must be preofixed by the
word local set
exit
trap
. filename for executing another command
$i ->arguments
$# ->parameter count
$@ ->all parameters
$$ ->PID
$- ->shell invocation flags
${name1*name2} conditional substiution
-lt -gt -o -a -ne = set

redirect stdout to file
& redirect stdout and file

append to file
<, <&
<< read till word after $ expansion is done on the word
| sort of like ><

user management
pw
adduser
chsh

kernel management
halt reboot shutdown nextboot fastbooot fasthalt dmesg
kenv sysctl savecore kldload kldunload kldconfig kldstat loader
kdump ktrace kdbg

harddisk management
mount_* umount
sync
g*
swapon swapoff
dumpfs
fdisk newfs disklabel
fsck badsect
tunefs
atacontrol
cdcontrol
swapinfo

mdconfig – virtual disk management
ldconfig – library management

adjkerntz

conscontrol
vidcontrol
kbdcontrol
camcontrol

mixer

devd
devfs
scanpci
devinfo

networking
ifconfig
sockstat
routed
ipf pfctl pflogd
dhclient, script
ping
traceroute
whois
dig
art
mesg
write
talk
login
nologin
getty
stty
mail
script
nfsstat
ipfw

daemons
nfsd
sshd
ftpd
telentd
talkd
crond

filemanagement
cd
pwd
cpio
rm
rmdir
mkdir
ls
mv
ln
unlink
du
df
md5
sha256
sha1
md5
ar
tar
bz2
compress
pax
rdump rrestore

help
man
whatis
apropos
ed

processs management
at
ps
vmstat
top
sleep
kill
pkill
who
fg
fc
exec
mkfifo
nice
watch
wait

xserver xhost, xauth, xdm done
kerberos
rlogind
telnetd
jaild
nfsd
lpd
crond
httpd, httpc
httptunneld, httptunnelclient
sendmail
tracker

squid
squidguard
dhcpd
named
routed
ipfilter
inetd
irc
jabber
dc

cvsd svnd

xhost + machinn will give machine the access to your display
/etc/Xn.hosts file is to store the common machines

xauth will start a xauth session
add machine protocol hexkey
extract file machine
generate machine protocol [trusted|untrusted|timeout] [group groupid – that the machines will be displayed here]
list
merge filename
remove
exit
info info about the xauth file
quit
help
?

machine:0 implies the key this xserver gives to machine
machine/unix:0 implies the key this xserver requires

xfwp
proymngr
xfindproxy are used to add another layer for this security
xmodmap

adduser
rmuser
chmod
chown
chpass
pw
stickybit->deleting only by owner or root in th dir
retain the executable image in memory even after exit
setuidbit->for su and executing as owner
setgidbit-> “ group member
for directories implies everything within this directory would be the
owners || the groups
who to display current users onn thee system
w
users

pw also has lock unlock abilities
to kick user, kill his lgin process