From LedHed's Wiki
Jump to: navigation, search
Line 22: Line 22:
 
  -h                  = human readable
 
  -h                  = human readable
 
  -s                  = summarize (Display only total for each arguement)
 
  -s                  = summarize (Display only total for each arguement)
 +
 +
'''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
 +
  
 
More to come...
 
More to come...
  
 
[[Category:Linux]]
 
[[Category:Linux]]

Revision as of 23:13, 17 December 2006

Linux Commands that I rarely use and often forget.

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

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

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)

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


More to come...