11-1
Day 6
gdfdgdfdh
fhfjdfhjgfh
gfgjdfhgjd
hffkkfjgkfj
11-2
Creating Backups
• Backup tools used:
– Gzip
– Bzip2
– Zip
– Tar
• Compressing files
• Decompressing files
• List the...
11-3
Gzip
• gzip--Gzip compress the size of the given files using Lempel-Ziv coding (LZ77).
Whenever possible, each file i...
11-4
Bzip2
• bzip2 :bzip2 compresses files using the Burrows-Wheeler block sorting text
compression algorithm, and Huffman...
11-5
Zip
• zip : zip is a compression and file packaging utility for Unix/Linux. Each file is 
stored in single .zip {.zip...
11-6
Tar
• tar : The GNU tar is archiving utility but it can be use to compressing large file(s). 
GNU tar supports both a...
11-7
Tar
– Untar or decompressed a file(s) that is created using tar compressing 
through gzip and bzip2 filter
syn: tar -...
11-8
Copying Files Remotely
• scp stands for secure cp (copy), which means you can copy files across ssh 
connection. That...
11-9
SCP
• SCP Options
-p: Preserves the modification and access times, as well as the permissions
of the source-file in t...
11-10
SCP Examples
• Copy files from a local computer to a remote computer
ex: scp somefile username@server:/home/username...
11-11
cURL and Wget
• cURL : is a software package which consists of command line tool and a library
for transferring data...
11-12
cURL and Wget
• Wget is a free utility for non-interactive download of files from the Web. It
supportsHTTP, HTTPS, a...
11-13
Network Troubleshooting
• ping: will ping the host to see if it is alive or not.
syn: ping [options] <host_name>
Ex:...
11-14
Network Troubleshooting
ifup and ifdown
• ifup - bring a network interface up
• ifdown - take a network interface do...
11-15
Network Troubleshooting
• netstat– shows network status.
ex: netstat #Displays generic net statistics of the host yo...
11-16
Upcoming SlideShare
Loading in...5
×

Basic Linux day 6

310

Published on

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
310
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Basic Linux day 6

  1. 1. 11-1 Day 6 gdfdgdfdh fhfjdfhjgfh gfgjdfhgjd hffkkfjgkfj
  2. 2. 11-2 Creating Backups • Backup tools used: – Gzip – Bzip2 – Zip – Tar • Compressing files • Decompressing files • List the contents of an archive/compressed file
  3. 3. 11-3 Gzip • gzip--Gzip compress the size of the given files using Lempel-Ziv coding (LZ77). Whenever possible, each file is replaced by one with the extension .gz. syn: gzip {filename} ex: gzip mydata.doc • Decompressing a file that is created using gzip command. File is restored to their original form using this command. syn: gzip -d {.gz file} gunzip {.gz file} ex: gzip -d mydata.doc.gz gunzip mydata.doc.gz • List files from a GZIP archive syn: gzip -l {.gz file} ex: gzip -l mydata.doc.gz
  4. 4. 11-4 Bzip2 • bzip2 :bzip2 compresses files using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. Compression is generally considerably better than that achieved by gzip command. Whenever possible, each file is replaced by one with the extension .bz2. syn: bzip2 {filename} ex: bzip2 mydata.doc • Decompressing a file that is created using bzip2 command. File is restored to their original form using this command. syn: bzip2 -d {.bz2-file} bunzip2 {.bz2-file} ex: bzip2 -d mydata.doc.bz2 gunzip mydata.doc.bz2 • Listing the files from a bzip2 archive is not possible
  5. 5. 11-5 Zip • zip : zip is a compression and file packaging utility for Unix/Linux. Each file is  stored in single .zip {.zip-filename} file with the extension .zip. syn:  zip {.zip-filename} {filename-to-compress} ex: zip mydata.zip mydata.doc • Extract compressed files in a ZIP archive. syn: unzip {.zip file} ex: unzip file.zip • List files from a ZIP archive syn: unzip -l {.zip file} ex: unzip -l mydata.zip
  6. 6. 11-6 Tar • tar : The GNU tar is archiving utility but it can be use to compressing large file(s).  GNU tar supports both archive compressing through gzip and bzip2. If you have  more than 2 files then it is recommended to use tar instead of gzip or bzip2. syn:   tar -zcvf {.tgz-file} {files} tar -jcvf {.tbz2-file} {files} Options -c - Create/copy -f – files -v – Verbose -z: use gzip compress -j: use bzip2 compress ex:  tar -zcvf packagename.tar.gz files/dirs
  7. 7. 11-7 Tar – Untar or decompressed a file(s) that is created using tar compressing  through gzip and bzip2 filter syn: tar -zxvf {.tgz-file} tar -jxvf {.tbz2-file} Options -x - Extract -v - Verbose -f – files ex: tar -zxvf packagename.tar.gz – List files from a TAR archive Options -t - Tabular view -v - Verbose -f – files ex: tar -tvf packagename.tar.gz
  8. 8. 11-8 Copying Files Remotely • scp stands for secure cp (copy), which means you can copy files across ssh  connection. That connection will be securely encrypted, it is a very secure way to  copy files between computers. syn: scp [[user@]from-host:]source-file [[user@]to-host:][destination-file] from-host Is the name or IP of the host where the source file is, this can be omitted if the from-host is the host where you are actually issuing the command user Is the user which have the right to access the file and directory, that is supposed to be copied in the case of the from-host, and the user who has the rights to write in the to-host source-file Is the file or files that are going to be copied to the destination host, it can be a directory but in that case you need to specify the -r option to copy the contents of the directory destination- file Is the name that the copied file is going to take in the to-host, if none is given all copied files are going to keep its names
  9. 9. 11-9 SCP • SCP Options -p: Preserves the modification and access times, as well as the permissions of the source-file in the destination-file -q: Do not display the progress bar -r: Recursive, so it copies the contents of the source-file (directory in this case) recursively -v: Displays debugging messages
  10. 10. 11-10 SCP Examples • Copy files from a local computer to a remote computer ex: scp somefile username@server:/home/username/ ser@remote.server.com:/home/user/ • Copy files from a remote server to your local computer ex: scp username@server:/home/username/file_name /home/local-username/file-name • Copy files from a remote server to another remote computer ex: scp user_name1@server1:/home/user_name1/file_name user_name2@server2:/home/user_name2/
  11. 11. 11-11 cURL and Wget • cURL : is a software package which consists of command line tool and a library for transferring data using URL syntax. • Download a Single File ex: curl http://google.com • The above command will get the content of the URL and display it in the STDOUT (i.e. on your terminal). • To store the output in a file, you an redirect it as shown below. This will also display some additional download statistics.
  12. 12. 11-12 cURL and Wget • Wget is a free utility for non-interactive download of files from the Web. It supportsHTTP, HTTPS, and FTP protocols • In order to download the web page google.com you would type wget google.com • The result will be saved as a file in the current directory. You can open and view the file with a web browser. • If there are connection problems wget will try up to 20 times to reconnect. You can use the -t option to change the maximum number of attempts. For example, with wget -t 10 google.com • it will try only up to 10 times.
  13. 13. 11-13 Network Troubleshooting • ping: will ping the host to see if it is alive or not. syn: ping [options] <host_name> Ex: ping google.com ping google.com –c1 <linux> ping google.com –t <windows> • ifconfig: This command allows the operating system to setup network interfaces and allow the user to view information about the configured network interfaces. ex: ifconfig eth0 #view the network settings on the first Ethernet adapter ifconfig –a #Display info on all network interfaces on server,active or inactive. ifconfig eth0 down #If eth0 exists would take it down causing it cannot send or receive any information ifconfig eth0 up #If eth0 exists and in the down state would return it back to the up state
  14. 14. 11-14 Network Troubleshooting ifup and ifdown • ifup - bring a network interface up • ifdown - take a network interface down ex: ifup -a #Bring up all the interfaces defined with auto in /etc/network/interfaces ifup eth0 #Bring up interface eth0 ifdown -a #Bring down all interfaces that are currently up. • Telnet: to connect to another remote computer. ex: telnet <ip_address> telnet <ip_address> <port>
  15. 15. 11-15 Network Troubleshooting • netstat– shows network status. ex: netstat #Displays generic net statistics of the host you are currently connnected to. netstat –an #shows all the connections to the server including the source and destination ips and ports if you have the proper permissions. netstat –natp #display active internet connections netstat –an|grep :80 #displays the active connection on port 80
  16. 16. 11-16
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×