Monday, March 31, 2014

some useful linux command

1) change mode of one file
#make a file run
chmod u+x filename

2) mount vbox shared sholder
sudo mount -t vboxsf shared_folder /mount/point

3) shutdown computer
/sbin/shutdown -h now

4) ping
ping -c 5 ip_address

5) route
/sbin/ip route show

6) disk space
df -h

7) format disk
mkfs.ext4 /dev/sda3

8) convert language format
iconv -f gb18030 -t utf-8 file1 > file2

9) enter cpan shell
sudo perl -MCPAN -e shell

10) GPG
#generate key
gpg --gen-key

#show gpg keys
gpg --list-keys

#export key
gpg --export -a 'Scott Hsu' > public.key
gpg --export-secret-keys -a 'Scott Hsu' > private.key

#import key
gpg --import public.key
gpg --import private.key

#delete key
gpg --delete-secret-keys 'Scott Hsu'
gpg --delete-keys  'Scott Hsu'

#encrypt file
gpg --encrypt --recipient 'Scott Hsu' SSN.pdf

#decrypt
gpg --output SSN.pdf --decrypt SSN.pdf.gpg

#sign file
gpg --output file.doc.sig --sign file.doc

#decrypt signed file
gpg --output file.doc --decrypt file.doc.sig

11) split file
 tar -jcvf - SSN.pdf.zip | split -b 500KB - SSN.pdf.gpg.zip.tbz2.

No comments:

Post a Comment