-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- -_ Jeremy's Linux Quick Tips version 1.6.1 _- -_ http://www.dcos.net/projects/linux-quick-tips-1.6.1.text _- -_ E-Mail: info@dcos.net _- -_ licensed: CC-BY-SA _- -_ Document format: command's first, 1 line comment follows _- -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- date MMDDhhmmYY setting date and time date YYYYMMDDhhmm setting date and time on busybox's date command(think embedded systems) ifconfig -i eth0 192.168.0.100 netmask 255.255.255.0 up static ip route add default gw 192.168.0.1 static gateway domain some.dns.providor.net nameserver #.#.#.# nameserver #.#.#.# static dns for the contents of file /etc/resolv.conf iptables -A INPUT -i eth1 -p tcp -m tcp --dport 80 -j ACCEPT iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j DNAT --to-destination 192.168.0.100:80 iptables port forwarding su use this do not use root login its bad practice. and type exit when your done sudo su great quick root access if in the sudoers group. ubuntu and others. e2fsck -fc /dev/hda1 works the same as typing scandisk in a windows/dos system, -f is force, -c is check for bad blocks(very time consuming) sudo mount -rw /dev/sda1 mount a usb pendrive "that is if its the only usb device, and theres no sata or scsi disks. if so it would be /dev/sdb,c,d, or e if theres a card reader" mount -l shows a list of mounts along with type info sudo umount /dev/sda1 unmounts the previos device "always unmount a usb pen!" you may have noticed sudo in front of most commands.you have to be root to mount a drive writeable mount -o loop -t iso9660 /path/to/cdimage.iso /mnt/point/ i hope you cought on enough dd if=/dev/cdrom of=cdimage.iso creates an iso image of a cdrom "do not mount the drive!" chroot /new/root-directory /bin/bash-or-some-shell-u-like tar -acf somearchive.tar.lzma /some-folder-of-stuff-to-add creates an archive in lzma format(high compressor) ssh -p ### user@host.domain.topmost secure shell usage ### being port number -p meaning use this port scp -P ### /path/to/localdir/orfile.txt user@host.domain.topmost:/path/to/save/point/andfilename.txt copies over ssh to a remote host your local file reverse the local and remote section to change the copy direction to local from remote. ssh user@host -L [Local Adress:]:: Single Port Tunneling with SSH forwards local port traffic to remote host and specified port ssh user@host -D Dynamic Port Tunneling with SSH creates a socks proxy on the system it is run on top process list real time, press 1 and z when its loaded for extra func. ps aux process list ALL process's also sleeping and non topmost ls -la directory listing "like dir in dos/win" --help preceed with a space, but type that after ANY COMMAND and you will get a great quick usage refreance thiscommandisafake made you look :) netstat -a | grep tcp will display only tcp connections and no unix sockets netstat -p will display programs running that have a connection and its process id(pid) w,users,who varios ways of showing who is loged in. uptime display uptime uname -a system information arch type kern type etc etc. links,lynx,elinks,w3m,netrik web browsers, text based no images fbi frame buffer image-viewer sudo mplayer -fs -vo fbdev /location/of/file.avi will play file.avi at the shell "without" a gui sudo xine -V fb /location/of/file.avi will play file.avi at the shell "without" a gui xmms think winamp. . . . nano, pico text editor, similar to edit for dos, not a clone cat somefile.txt displays contents of file cat somefile.txt | more displays contents of file in a scrollable form cat somefile.txt | grep 10-9.2 would display the entire line that contains a matching 10-9.2 "can be anything to grep for" uname -a >> unameinfo.txt saves the output to the file unameinfo.txt. this >> is append, > is overwrite. last lists all the last login sessions last -n 10 displays the last 10 login sessions id gives user info typed alone about who your loged in as id username about this said user adduser -m adds a user usermod -G group1,group2 username adds the user to the 2 groups ln -s /symlink/dir/ /actual/directory/ symlink symulates a dirs presense and redirects everything to the actual dir. wget http://dcos.net/projects/Linux-Quick-Tips-1.6.1.txt would download this file from my site "great for grabing hard to get scripts" emacs editor, press ctrl-x-ctrl-c to quit. ctrl-x-ctrl-s to save. vi, vim editor, press shift and : then q then enter to exit. wq and enter to save and exit echo "this is an example" && echo " " && echo "notice the way this works?" && w && ls -a side note, && means only run next command if previos command didnt fail ;) quite usefull btw