Difference between revisions of "Linux Commands"

From Hack Sphere Labs Wiki
Jump to: navigation, search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
Sometimes I just cant remember what to type.
 
Sometimes I just cant remember what to type.
 +
==ssh and run x appz==
 +
ssh -X then whatever
 +
then while in command line run
 +
yourdamcommand &
  
 
==Linux SSH Saved Cert Upload and Login==
 
==Linux SSH Saved Cert Upload and Login==
Line 18: Line 22:
 
  bg
 
  bg
 
Your command is running.
 
Your command is running.
 +
 +
=rar=
 +
 +
rar a -m0 -v4G output.rar INPUT.DIRECTORY
 +
 +
=tar=
 +
 +
Syntax:
 +
To Tar:
 +
tar –cvzf tarfilename foldername
 +
 +
Untar:
 +
tar –xvzf tarfilename
 +
 +
=shred=
 +
 +
To destroy contents of a file:
 +
 +
shred -fv files

Latest revision as of 13:04, 9 June 2012

Sometimes I just cant remember what to type.

ssh and run x appz

ssh -X then whatever

then while in command line run

yourdamcommand &

Linux SSH Saved Cert Upload and Login

It is usually a bad idea to do this...

ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub '-p ***** webdawg@*.*.*.*'
alias torbox="ssh -p ***** webdawg@*.*.*.*"

bg

  • bg

If you need to run a command in the background and do not have access to screen or a crontab then start the process and hit CTRL + Z. The process will suspend. You then need to use bg to resume the process. It will stay in the background and keep moving. The command accepts PIDS too.

If you have only ran/suspended one command then you do not need to specify a PID.

mycommand > log.log

CTRL + Z

bg

Your command is running.

rar

rar a -m0 -v4G output.rar INPUT.DIRECTORY

tar

Syntax: To Tar: tar –cvzf tarfilename foldername

Untar: tar –xvzf tarfilename

shred

To destroy contents of a file:

shred -fv files