Unix‎ > ‎

basics


tar with tstamp
tar cvzf file$(date +%F).tar <dir>
tar -cvf <filename.tar> <file1 file2 .... > #extract tar -xvf <filename.tar> #list tar -tvf <filename.tar> options: z - to gzip the file

soft Link
ln -s <ORIGINAL> <SOFTLINK>

redirect
redirect stdin and stdout
cmd >>file.txt 2>&1


SSH with key
ssh -i "key1-aws.pem" ec2-user@ec2-52-19-91-237.eu-west-1.compute.amazonaws.com

Create SSH tunnel
ssh -L 9000:localhost:5432 user@example.com

Mount ssh/sft folder
sshfs ajcm@shuttle ~/var

Mount vbox shared
sudo mount -t vboxsf shared ~/shared






Comments