Page 156 - DCAP602_NETWORK_OPERATING_SYSTEMS_I
P. 156

Network Operating Systems-I




                    notes          wc : word count
                                   wc -l filename.txt : tells how many lines are in filename.txt

                                   cp : copy a file
                                   cp filename filename.backup : copies filename to filename.backup
                                   cp -a /home/burst/new_design/* /home/burst/public_html/ : copies
                                   all files, retaining permissions form one directory to another.
                                   cp -av * ../newdir : Copies all files and directories recurrsively in the current directory INTO
                                   newdir


                                   mv : Move a file command
                                   mv oldfilename newfilename : Move a file or directory from oldfilename to newfilename



                                   rm : delete a file
                                   rm filename.txt : deletes filename.txt, will more than likely ask if you really want to delete it
                                   rm -f filename.txt : deletes filename.txt, will not ask for confirmation before deleting.

                                   rm -rf tmp/ : recursively deletes the directory tmp, and all files in it, including subdirectories. BE
                                   VERY CAREFULL WITH THIS COMMAND!!!



                                   tar: Creating and Extracting .tar.gz and .tar files
                                   tar -zxvf file.tar.gz : Extracts the file
                                   tar -xvf file.tar : Extracts the file
                                   tar -cf archive.tar contents/ : Takes everything from contents/ and puts it into archive.tar
                                   gzip -d filename.gz : Decompress the file, extract it



                                   Zip files:Â  Extracting .zip files shell command
                                   unzip file.zip


                                   firewall -Â iptables commands

                                   iptables -i input -s ipaDDressHere -j Drop : This command stops any connections from
                                   the IP address
                                   iptables -L : List all rules in iptables

                                   iptables -F : Flushes all iptables rules (clears the firewall)
                                   iptables --save : Saves the currenty ruleset in memory to disk service iptables restart : Restarts
                                   iptables



                                   apache shell commands
                                   httpd -v : Outputs the build date and version of the Apache server.




          150                              LoveLy professionaL university
   151   152   153   154   155   156   157   158   159   160   161