Linux Commands
Linux Commands
- RPM Version Info:
rpm -qa foo
- Shutdown X11:
init 3
- Reboot the System:
init 6
- Mount a CDROM:
mount /dev/cdrom
- Unmount a CDROM:
umount /dev/cdrom
- List Start Up Scripts:
chkconfig --list
- Turn On Start Up Script:
chkconfig service start
- Turn Off Start Up Script:
chkconfig service off
- Get the kernel version by typing
uname -r
- Format USB Device to Vfat
mkfs.vfat -F 32 /dev/sda1
- How to create tarball's assuming your directory is called foo:
tar -cvzf foo.tar.gz /dir/foo
- Add user to Virtual Postfix Database:
postmap virtual
- Reload Postfix:
postfix reload
- Produces Postfix Queue List:
postqueue -p
- Also Produces Postfix Queue List:
mailq
- Flush Postfix Queues:
postqueue -f
- Remote Desktop for Windows (toggle -f on or off for fullscreen):
rdesktop -g 1152x768 -a 24 -b -f mail
- Unzip bz2 files:
bzip2 -cd files.tar.bz2 | tar xvf -
- Show program install path:
which {program}
- Removes mail from mail queue
postsuper -d {queue id}>
- Displays Hardware info from BIOS (must have installed dmidecode installed)
dmidecode
- To get a Network list of current IP/Hostname's, type the following on the command line:
dig axfr hosthame
- or to sort by IP type:
dig axfr hostname |grep IN | egrep A |sort -n -k 5 -k 7 -t .
- Type the following to setup rpmq to find true kernel version
alias rpmq='rpm --qf '\''%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n'\'' -q'
- Type the following to determine the kernel version
rpmq kernel
- List all PCI Devices:
lspci
- Reload named:
rndc reload
- Create Database:
create database {DATABASE NAME};
- Create Database Privileges:
grant all privileges on {DATABASE NAME}.* to {DATABASE USER}@localhost identified by '{DATABASE PASSWORD}';
- Set Privileges:
flush privileges;
- Netstat IP,PORTS
netstat -tnap