From LedHed's Wiki
Jump to: navigation, search
Line 2: Line 2:
 
<br>
 
<br>
 
<br>
 
<br>
 +
 +
== Print Working Directory (pwd) ==
 +
 
pwd = (Print Working Directory) Displays the current directory you're in.<br>
 
pwd = (Print Working Directory) Displays the current directory you're in.<br>
 
<br>
 
<br>
 +
 +
 +
== Network Map (nmap) ==
 +
 
nmap = (Network Map) Utility that displays open network ports.<br>
 
nmap = (Network Map) Utility that displays open network ports.<br>
 
''Basic usage: nmap 192.168.0.1 ''
 
''Basic usage: nmap 192.168.0.1 ''
 
<br>
 
<br>
<br>
+
 
 +
 
 +
 
 +
== String Filter (grep) ==
 +
 
 
grep = Hard to explain, Filtering utility.<br>
 
grep = Hard to explain, Filtering utility.<br>
 
''Basic usage: grep 'FilterString' filename<br>
 
''Basic usage: grep 'FilterString' filename<br>
Line 23: Line 34:
 
  -s                  = summarize (Display only total for each arguement)
 
  -s                  = summarize (Display only total for each arguement)
  
'''TAR'''
+
 
 +
== File Comptession (tar) ==
 +
 
  
 
''Basic usage''
 
''Basic usage''
Line 41: Line 54:
 
  -p                  = Preserve file permissions
 
  -p                  = Preserve file permissions
 
  -f                  = File
 
  -f                  = File
 +
-M                  = Multi-Volume
 +
-L                  = Tape Length (or --tape-length=) accepts values in Kb.  Size = value x 1024
 +
 +
'''Span Multiple Files Example'''
 +
This will create multiple files 100MB in size (100 x 1024 = 102400)
 +
tar -c -M -L=102400 --file=filename.part1.tar largefile.to.split.iso
 +
<br>
 +
When the first part is complete you will be presented a prompt like this:
 +
Prepare Volume #2 for 'filename.part1.tar' and hit return:
 +
<br>
 +
To tell Tar that we want to continue with a new file we enter this:
 +
n filename.part2.tar
 +
<br>
 +
Now you will be presented this prompt:
 +
Prepare Volume #2 for 'filename.part2.tar' and hit return:
 +
Notice the filename was accepted ''filename.part2.tar'.  Now just press ''return''
 +
<br>
 +
<br>
 +
To Extract spanned tar files do this:
 +
tar -x -M --file=filename.part1.tar largefile.that.was.split.iso
 +
<br>
 +
You will be prompted with this:
 +
Prepare volume #2 for filename.part1.tar and hit return: n filename.part2.tar
 +
Prepare volume #2 for filename.part2.tar and hit return:
 +
Now Press Retuen.
 +
Thats it.
 +
 +
  
  

Revision as of 20:11, 15 March 2007

Linux Commands that I rarely use and often forget.

Print Working Directory (pwd)

pwd = (Print Working Directory) Displays the current directory you're in.


Network Map (nmap)

nmap = (Network Map) Utility that displays open network ports.
Basic usage: nmap 192.168.0.1


String Filter (grep)

grep = Hard to explain, Filtering utility.
Basic usage: grep 'FilterString' filename
Usefull grep options:

-i 'FilterString'   =   case insensitive
-b #                =   Display # number of lines BEFORE a match
-a #                =   Display # number of lines AFTER a match
-v                  =   Invert Match or Exclusion
'FilterString1'\|'FilterString2'\|'FilterString3'  =  Multiple Filters


du = List the size of a file or Directory
Basic usage: du -hs <file or dir>
Usefull du options:

-h                  = human readable
-s                  = summarize (Display only total for each arguement)


File Comptession (tar)

Basic usage

to create a tar archive:

tar -pcvzf filename.tgz directory1/ directory2/

to extract an archive

tar -xvzf filename.tgz -C destination_directory/

Usefull tar options:

-x                  = extract
-c                  = create
-v                  = verbose (displays whats being archived or extracted on screen)
-j                  = use BZip format (.tar.bz2)
-z                  = use GZip format (.tar.gz or .tgz)
-p                  = Preserve file permissions
-f                  = File
-M                  = Multi-Volume
-L                  = Tape Length (or --tape-length=) accepts values in Kb.  Size = value x 1024

Span Multiple Files Example This will create multiple files 100MB in size (100 x 1024 = 102400)

tar -c -M -L=102400 --file=filename.part1.tar largefile.to.split.iso


When the first part is complete you will be presented a prompt like this:

Prepare Volume #2 for 'filename.part1.tar' and hit return:


To tell Tar that we want to continue with a new file we enter this:

n filename.part2.tar


Now you will be presented this prompt:

Prepare Volume #2 for 'filename.part2.tar' and hit return:

Notice the filename was accepted filename.part2.tar'. Now just press return

To Extract spanned tar files do this:

tar -x -M --file=filename.part1.tar largefile.that.was.split.iso


You will be prompted with this:

Prepare volume #2 for filename.part1.tar and hit return: n filename.part2.tar

Prepare volume #2 for filename.part2.tar and hit return: Now Press Retuen. Thats it.



More to come...