A list of commands and their syntax, some of which for some reason, seem to escape me only when I need it.
tar -cvf
tar -cvf – * | ssh root@ ‘cd /home;tar xvf -’ (creates a tar archive of current directory and sends it via ssh to a destination host and unpacks at the destination)
zip -r
rsync -auEv
rsync -auvEe ssh root@192.168.0.1:/home/me/folder1 /home/you (copies from another host using ssh and the remote user “root” to login and gain access to /home/me/folder1 and copy it locally to /home/you/folder1)
strace -p
ssh -x
ssh -L 9999:192.168.0.1:3389
ssh -XC
iostat 1 100 (run iostat every second 100 times)
netstat -rn (show routing table, and don’t resolve names)
netstat -an (show all enabled ports and sockets on an operating system)
arp -a (show the current arp table)
dmidecode (show hardware information for your running system)
rpm -qPpl
rpm -qa –qf ‘%{name}%{version}%{release}%{arch}\n’ | egrep ‘
rpm -ql
iptables -A INPUT -p tcp –dport 22 -s 192.168.0.2 -j DROP (creates a rule in memory that allows iptables to drop incoming ssh connections that originate from 192.168.0.2.) Add this to a start script to make this persistent!
setfacl -m d:u:bob:rw /home/bob (set a user acl with read/write access on the directory /home/bob)
free (show memory related information)
ldd /usr/bin/sshd (shows all shared libraries that the ssh daemon uses/requires)
find /etc -depth | cpio -pdmV /tmp/etcbackup (searches for everything listed in /etc (recursive) and sends the results to cpio, which in turn places all files in /tmp/etcbackup..this is much cleaner than cp -a..Also, you can add a “u” to the cpio to do this unconditionally.)
find /var -print | xargs du |sort -g (searches in /var and all sub directories (recursive) below for all files and puts them in numerical order according to their size.)
Recent Comments