Shell Commands
Script command sessions
To log your terminal sessions used script
command:
$script /tmp/terminal.log
CTRL+D to end script logging.
Courtesy of Unix Tutorial site
vi
Tape Archival (tar)
Create tar
tar -cvf filename.tar filemane
Undo tar
tar -xvf filename.tar
List contents tar
tar -tvf filename.tar
gzip
Compress file
gzip -9 filename
Decompress file
gzip -d filename
Download files
To download type wget
then location of file.
Check file integrity
Check MD5 checksum by using md5sum filename
then compare.
ifconfig
To determine your IP address settings run:
ifconfig
Searching
To find path to a file run:
# find / -name "filename"
To find an expression within a file:
List open files
For example:
lsof -i tcp:80
Comparing files
How do I compare two files under linux or unix
Customize BASH prompt
Customize your bash prompt basics
Tips
Find version of OS
cat /etc/redhat-release
cat /etc/redhat-release
cat /etc/fedora-release
cat /etc/SuSE-release
Password protect with Apache
Password protect your pages with htaccess
Users and Groups
Hardware
Graphics card
Determine your graphic card run lspci command and find line that contains VGA compatible:
[paul@templar ~]$ lspci 00:00.0 Host bridge: nVidia Corporation C55 Host Bridge (rev a2) 00:00.1 RAM memory: nVidia Corporation C55 Memory Controller (rev a1) 00:00.2 RAM memory: nVidia Corporation C55 Memory Controller (rev a1) 00:00.3 RAM memory: nVidia Corporation C55 Memory Controller (rev a1) 00:00.4 RAM memory: nVidia Corporation C55 Memory Controller (rev a1) 00:00.5 RAM memory: nVidia Corporation C55 Memory Controller (rev a2) 00:00.6 RAM memory: nVidia Corporation C55 Memory Controller (rev a1) 00:00.7 RAM memory: nVidia Corporation C55 Memory Controller (rev a1) 00:01.0 RAM memory: nVidia Corporation C55 Memory Controller (rev a1) 00:01.1 RAM memory: nVidia Corporation C55 Memory Controller (rev a1) 00:01.2 RAM memory: nVidia Corporation C55 Memory Controller (rev a1) 00:01.3 RAM memory: nVidia Corporation C55 Memory Controller (rev a1) 00:01.4 RAM memory: nVidia Corporation C55 Memory Controller (rev a1) 00:01.5 RAM memory: nVidia Corporation C55 Memory Controller (rev a1) 00:01.6 RAM memory: nVidia Corporation C55 Memory Controller (rev a1) 00:02.0 RAM memory: nVidia Corporation C55 Memory Controller (rev a1) 00:02.1 RAM memory: nVidia Corporation C55 Memory Controller (rev a1) 00:02.2 RAM memory: nVidia Corporation C55 Memory Controller (rev a1) 00:03.0 PCI bridge: nVidia Corporation C55 PCI Express bridge (rev a1) 00:06.0 PCI bridge: nVidia Corporation C55 PCI Express bridge (rev a1) 00:07.0 PCI bridge: nVidia Corporation C55 PCI Express bridge (rev a1) 00:09.0 RAM memory: nVidia Corporation MCP51 Host Bridge (rev a2) 00:0a.0 ISA bridge: nVidia Corporation MCP51 LPC Bridge (rev a3) 00:0a.1 SMBus: nVidia Corporation MCP51 SMBus (rev a3) 00:0a.2 RAM memory: nVidia Corporation MCP51 Memory Controller 0 (rev a3) 00:0b.0 USB Controller: nVidia Corporation MCP51 USB Controller (rev a3) 00:0b.1 USB Controller: nVidia Corporation MCP51 USB Controller (rev a3) 00:0d.0 IDE interface: nVidia Corporation MCP51 IDE (rev a1) 00:0e.0 IDE interface: nVidia Corporation MCP51 Serial ATA Controller (rev a1) 00:0f.0 IDE interface: nVidia Corporation MCP51 Serial ATA Controller (rev a1) 00:10.0 PCI bridge: nVidia Corporation MCP51 PCI Bridge (rev a2) 00:10.1 Audio device: nVidia Corporation MCP51 High Definition Audio (rev a2) 00:14.0 Bridge: nVidia Corporation MCP51 Ethernet Controller (rev a3) 01:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 8800 GT] (rev a2) [paul@templar ~]$