Getting mulitple files from ftp server with out any prompt

0 comments

How to get lot of multiple file from server I am using
FTP command(mget ...), but each file asked "yes/no", every file should be put 'yes'
then 'Enter'?

we can resolve this issue in two ways


1)when you are accessing FTP server use -i option which is nothing but interactive way to get files from FTP server, actually this -i option will disable iteractive download of files from server.

Syntax:ftp -i server-ip/servername
#ftp -i 222.1.89.1

2)This is used when you are middle of the transaction you can use prompt command in ftp mode to get multiple files with out any prompt, here is the example and this is for that session

ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
-rw-r--r-- 1 1005 0 47 Apr 11 19:37 file1.txt
-rw-r--r-- 1 1005 0 47 Apr 11 19:37 file2.txt
-rw-r--r-- 1 1005 0 47 Apr 11 19:37 file3.txt
-rw-r--r-- 1 1005 0 47 Apr 11 19:37 file4.txt
226 Directory send OK.

ftp> prompt
Interactive mode off.

ftp> mget *
local: file1.txt remote: file1.txt
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for file1.txt (47 bytes).
226 File send OK.
47 bytes received in 0.00 secs (72.1 kB/s)
local: file2.txt remote: file2.txt
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for file2.txt (47 bytes).
226 File send OK.
47 bytes received in 0.00 secs (88.3 kB/s)
local: file3.txt remote: file3.txt
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for file3.txt (47 bytes).
226 File send OK.
47 bytes received in 0.00 secs (136.2 kB/s)
local: file4.txt remote: file4.txt
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for file4.txt (47 bytes).
226 File send OK.
47 bytes received in 0.00 secs (136.6 kB/s)

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Linux Troubleshooting

    0 comments

    When I first started working on Linux, I am interested in knowing how some of our Linux gurus in some online communities/forums/groups/user groups got started troubleshooting in Linux. So here i am going to tell you how to do Linux troubleshooting which I started back in 2004 when i am in my finial year B.E.


    Quick way of doing troubleshooting
    ==================================
    1)When I had a problem i will first look in to error either on console or log files which are most of the time located in /var/log folder
    2)If I still unable to find the root cause of the issue i will just Google it by just pasting the error code,most of the times i will get answers here if the issue is some what basic.
    3)Then post the issue in online forums,groups and orkut communities,Definitely experts will help you.
    4)Discuss with your seiners and friends who are in this Linux administration and try some thing.
    5)Last but not least try this if the servers are not in production environment restart the service and try to see you are able to resolve the issue and still if you face the issue try to reboot the server.

    Long way of doing troubleshooting
    =================================
    1)Study much about man pages,help pages on system and online documentation such as http://tldp.org/

    2)Participate in online

    * forums(example www.linuxforume.com,www.nixcraft.com etc)
    * groups(yahoo groups is best place and the google groups)
    * Communities in orkut.com
    * Read Linux blogs such as http://www.cyberciti.biz/


    3)Start with something you wanted to accomplish, for example, long time back i want to read one of my CHM format file in Linux which is by default not supported so I did a lot of googling. When
    I got as far as I could, I would then ask people who knew more.
    I think that's one way to start--find something specific you want to
    accomplish and figure out how to do it. Usually, in the course of doing
    it, you'll learn additional things that will help you with your next
    issue.
    4)Learn about other distro's which will improve your cross OS knowledge best place to learn is http://www.distrowatch.org. Just downloading distros and dual booting to them.
    5)Always update your self with latest technologies in linux

    these are my personal experiences which I learn, please let me know your way of troubleshooting.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Logical Volume Manager (LVM) in Redhat linux

    4 comments

    Configuring LVM.. Please watch full video and comment on it so that we can currect our mistakes..
    We like Feedback from you.. please comment on the video... Your comments are valuable to us to improve our Service.

    The following video shows how to configure LVM sit and relax and see the video..




    Unconfiguring LVM:In this video you will see how to unconfigure the LVM step by step..




    Please browse our site for other hot topics such as Linux interview questions.. Practical implementations of many Admin activities..

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Soft link Vs Hard link in Linux/*NIX

    0 comments

    Guest post by Sasi..


                                              Soft Link (Symbolic Link) & Hard Link
    Soft Link

    • Soft or symbolic is more of a short cut to the original file....if you delete the original the shortcut fails and if you only delete the short cut nothing happens to the original.
    • A 'soft link' is a symbolic link to another file either on the same file system or a different file system. A 'soft link' may span file systems while a 'hard link' must point to a file on the same file system.
    • A soft link (or symbolic link) is just a way of accessing files (or directories) without moving them. You just have to associate the path of the file with a special type of file (a link) which will lead you directly to it. It is called soft by comparison to a hard link which has different properties.
    • A soft link is basically a file that contains the absolute path of the file it is pointing to. The file system tools simply know to follow the link in the file. This allows us to link across the system
    Hard Link

    hard link is more of mirror copy....does something to file1 and it appears in file 2
    deleting one still keeps the other ok

    Difference between hard link and soft link
    Hard links share the same inode. Soft links do not.
    Hard links can't cross file systems. Soft links do

    In Linux, as in commercial Unix systems, the 'ln' command is used to create a symbolic link in file systems. A 'hard link' is a link pointing directly to a specific inode on the same file system.

    An example of a partial 'ls -al' listing of a single line from a /dev directory on a Linux system which illustrates the appearance of a symlinked file follows:

    lrwxrwxrwx 1 root root 3 Jan 13 22:05 cdrom -> hdc

    In this example, the /dev/cdrom device is symlinked to the /dev/hdc device making them effectively one and the same though with different names. The leading 'l' in the 'lrwxrwxrwx' permissions listing indicates that the listing is a symbolic link. [JMH]

    A hard link basically assigns another physical pointer to the same piece of data. This creates a limitation as it requires that the data be on the same logical disk as the link pointers location is designated by the inode of the data.


    This is first guest post on my blog,Author of this post is having 4 years extnsive knowledge on most of the *NIX flavors you can reach him @ Sasikanth Padigala (spadigala@gmail.com)

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Linux Interview questions:Experienced

    0 comments

    Experienced
    what is DNS?
    why we required CHROOT package? can you explain it?
    What is the location for DHCP server default leased configs file?
    what is the command and syntax to check DNS server named.conf file errors?
    What is the command and syntax to check DNS server zone files config errors?
    How do you update DNS zone file entries with out restarting named demon?
    What are the services/demons will restart when you restart NFS service?
    how do you update NFS sharing details with out restarting NFS server?
    What are the advantages of NIS?
    Can you explain me about LVM and how you configure LVM?
    What is the difference between LVM1 and LVM2?
    What is Amanda server and where is it used?
    Can you explain me corntab?
    How to resize LVM?
    Can you explain me about RAID5?
    How many RAID devices are there in RHEL5 by default?
    Min how many Raid devices will participate in RAID5?
    How do you do Kernel patching and what is the command?
    Can you explain me about in details how you do kernel recompilation?
    Can you explain what is the use fo access file in sendmail and what is its location?
    Can you explain me what is the advantage of local-hosts file and virtusertable in sendmail?
    How you will specify static IP's in DHCP server?
    how do you update NIS users with out restarting the NIS server?
    What is the partation no for LVM?
    What is the partation no for RAID?
    What is the port no for DNS?
    Can we change default port no for DNS? if yes, how?
    How many RAID device we can create in RHEL4?
    Can you explain me Disk quota in detail and configuration details?
    How to increase RAID devices after it excied max limit?

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Linux Interview Questions:Disk management

    0 comments

    Disk managamenent linux
    Click here for other interview questions

    1) How to creat swap if you dont have free partation?
    this is some what tricky question if you are new to Linux Administration
    here is the command to create swap if you dont have free partation
    before doing this you have switchoff the swap
    swapoff -a
    dd if=/dev/zero of=/root/swapfile bs=1k count=1024
    swapon filename

    2)How to see swap details?
       cat /proc/swap
       free

    3)How to see/get info about RAM in ur system
       free
       cat /proc/meminfo

    4)What is the difference between ext2 and ext3
      I)ext3=ext2+journaling
     "journaling" is an add-on to a filesystem that records changes as they are made.
    II)ext2 files system is fast
    III)less disk writes
    IV)ext2 file system in less stable/secure
    V)ext2 file system required to run fsck command if the system get crashed


    5)How to convert ext2 file system to ext3?
       tune2fs -j /dev/hda1


    6)How convert ext3 file system to ext2
       tune2fs -O^has-journal /dev/hda1


    7)What is default block/chunk size for PV
       4MB


    8)what is the command to update the diskquota on file system
       mount -o remount,rw /home

    9)What is the partation type number for swap,RAID,LVM?
       82(swap),fd(RAID),8e(LVM)


    10)What is the default block site for ext2,ext3,LVM,RAID?


    11)What is the difference between LVM1 and LVM2?



    12)What is difference between RAID0,1,5?

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Linux Interview Questions:Basic

    0 comments





    Basic linux interview questions
    1)How do you find out what’s your shell? - echo $SHELL
    2)What’s the command to find out today’s date? - date


    3)How do you find out the current directory you’re in? - pwd
    4)How do you find out your own username? - whoami/who am i
    5)How do you send a mail message to somebody? - mail surendra.anne@gmail.com -s ‘Your subject’ -c ‘test@gmail.com‘


    6)What’s the command to find out users on the system? - who/users
    7)How do you remove a file? - rm
    8)How do you remove a - rm -rf
    9)How do you count words, lines and characters in a file? - wc
    10)How do you search for a string inside a given file? - grep string filename


    11)How do you search for a string inside a directory? - grep string *
    12)How do you search for a string in a directory with the subdirectories recursed? - grep -r string *
    13)What are PIDs? - They are process IDs given to processes. A PID can vary from 0 to 65535.
    14)How do you list currently running process? - ps
    15)How do you stop a process? - kill pid


    16)How do you find out about all running processes? - ps -ag
    17)How do you stop all the processes, except the shell window? - kill 0
    18)How do you fire a process in the background? - ./process-name &
    19)How do you refer to the arguments passed to a shell script? - $1, $2 and so on. $0 is your script name.
    20)What’s the conditional statement in shell scripting? - if {condition} then … fi


    21)How do you do number comparison in shell scripts? - -eq, -ne, -lt, -le, -gt, -ge
    22)How do you test for file properties in shell scripts? - -s filename tells you if the file is not empty, -f filename tells you whether the argument is a file, and not a directory, -d filename tests if the argument is a directory, and not a file, -w filename tests for writeability, -r filename tests for readability, -x filename tests for excitability
    23)How do you do Boolean logic operators in shell scripting? - ! tests for logical not, -a tests for logical and, and -o tests for logical or.
    24)How do you find out the number of arguments passed to the shell script? - $#
    25)What’s a way to do multilevel if-else’s in shell scripting? - if {condition} then {statement} elif {condition} {statement} fi


    26)How do you write a for loop in shell? - for {variable name} in {list} do {statement} done
    27)How do you write a while loop in shell? - while {condition} do {statement} done
    28)How does a case statement look in shell scripts? - case {variable} in {possible-value-1}) {statement};; {possible-value-2}) {statement};; esac
    29)How do you read keyboard input in shell scripts? - read {variable-name}
    30)How do you define a function in a shell script? - function-name() { #some code here return }


    31)How does getopts command work? - The parameters to your script can be passed as -n 15 -x 20.Inside the script, you can iterate through the getopts array as while getopts n:x option, and the variable $option contains the value of the entered option.

  • Like the post? Please Subscribe to free RSS feed to get updates
  • Archive

    Translate this page

     

    The Linux Juggernaut | Copyright 2006-2009 Surendra Kumar Anne | Surendra's Home Page | Give us feedback how we are doing, Click here