• Increase font size
  • Default font size
  • Decrease font size
Tag:command

 Linux ftp Command

 

NAME
 
ftp - Internet file transfer program
SYNOPSIS
 
ftp [-pinegvd ] [host ] 
pftp [-inegvd ] [host ]
 
EXAMPLES 
 
 ftp abc.xyz.edu
This command will attempt to connect to the ftp server at abc.xyz.edu. If it succeeds, it will ask you to log in using a username and password. Public ftp servers often allow you to log in using the username "anonymous" and your email address as password. Once you are logged in you can get a list of the available ftp commands using the help function: 
 
 ftp> help
This lists the commands that you can use to show the directory contents, transfer files, and delete files. 
 
 ftp> ls
This command prints the names of the files and subdirectories in the current directory on the remote computer. 
 
 ftp> cd customers
This command changes the current directory to the subdirecotry "customers", if it exists. 
 
 ftp> cd ..
Changes the current directory to the parent direcotry. 
 
 ftp> lcd images
Changes the current directory on the local computer to "images", if it exists. 
 
 ftp> ascii
Changes to "ascii" mode for transferring text files. 
 
 ftp> binary
Changes to "binary" mode for transferring all files that are not text files. 
 
 ftp> get image1.jpg
Downloads the file image1.jpg from the remote computer to the local computer. Warning: If there already is file with the same name it will be overwritten. 
 
 ftp> put image2.jpg
Uploads the file image2.jpg from the local computer to the remote computer. Warning: If there already is file with the same name it will be overwritten. 
 
 ftp> !ls
A '!' in front will execute the specified command on the local computer. So '!ls' lists the file names and directory names of the current directory on the local computer. 
 
 ftp> mget *.jpg
With mget you can download multiple images. This command downloads all files that end with ".jgp". 
 
 ftp> mput *.jpg
Uploads all files that end with ".jgp". 
 
 ftp> mdelete *.jpg
Deletes all files that end with ".jgp". 
 
 ftp> prompt
Turns iteractive mode on or off so that commands on multiple files are executed without user confirmation. 
 
 ftp> quit
Exits the ftp program. 
 
 
DESCRIPTION
 
Ftp is the user interface to the Internet standard File Transfer Protocol. The program allows a user to transfer files to and from a remote network site.
Options may be specified at the command line, or to the command interpreter.

 

 

 UNAME(1)                         User Commands                        UNAME(1)


NAME
       uname - print system information
 
SYNOPSIS
       uname [OPTION]...
 
DESCRIPTION
       Print certain system information.  With no OPTION, same as -s.
 
       -a, --all
              print all information, in the following order, except omit -p and -i if unknown:
 
       -s, --kernel-name
              print the kernel name
 
       -n, --nodename
              print the network node hostname
 
       -r, --kernel-release
              print the kernel release
 
       -v, --kernel-version
              print the kernel version
 
       -m, --machine
              print the machine hardware name
 
       -p, --processor
              print the processor type or "unknown"
 
       -i, --hardware-platform
              print the hardware platform or "unknown"
 
       -o, --operating-system
              print the operating system
 
       --help display this help and exit
 
       --version
              output version information and exit
 
AUTHOR
       Written by David MacKenzie.
 
REPORTING BUGS
       Report bugs to .
 

 DF(1)                                            User Commands                                            DF(1)

 
NAME
       df - report filesystem disk space usage
 
SYNOPSIS
       df [OPTION]... [FILE]...
 
DESCRIPTION
       This manual page documents the GNU version of df.  df displays the amount of disk space available on the
       filesystem containing each file name argument.  If no file name is given, the  space  available  on  all
       currently  mounted  filesystems is shown.  Disk space is shown in 1K blocks by default, unless the envi-
       ronment variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used.
 
       If an argument is the absolute file name of a disk device node containing a mounted filesystem, df shows
       the  space  available on that filesystem rather than on the filesystem containing the device node (which
       is always the root filesystem).  This version of  df  cannot  show  the  space  available  on  unmounted
       filesystems,  because  on most kinds of systems doing so requires very nonportable intimate knowledge of
       filesystem structures.
 
OPTIONS
       Show information about the filesystem on which each FILE resides, or all filesystems by default.
 
       Mandatory arguments to long options are mandatory for short options too.
 
       -a, --all
              include filesystems having 0 blocks
 
       -B, --block-size=SIZE use SIZE-byte blocks
 
       -h, --human-readable
              print sizes in human readable format (e.g., 1K 234M 2G)
 
       -H, --si
              likewise, but use powers of 1000 not 1024
 
       -i, --inodes
              list inode information instead of block usage
 
       -k     like --block-size=1K
 
       -l, --local
              limit listing to local filesystems
 
       --no-sync
              do not invoke sync before getting usage info (default)
 
       -P, --portability
              use the POSIX output format
 
       --sync invoke sync before getting usage info
 
       -t, --type=TYPE
              limit listing to filesystems of type TYPE
 
       -T, --print-type
              print filesystem type
 
       -x, --exclude-type=TYPE
              limit listing to filesystems not of type TYPE
 
       -v     (ignored)
 
       --help display this help and exit
 
       --version
              output version information and exit
 
       SIZE may be (or may be an integer optionally followed  by)  one  of  following:  kB  1000,  K  1024,  MB
       1000*1000, M 1024*1024, and so on for G, T, P, E, Z, Y.
 

 Here's the most basic example of Linux df command, with output shown here from a CentOS Linux computer:

[root@hc]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda6              1035660    193892    789160  20% /
/dev/sda1               101086     16617     79250  18% /boot
none                   1037984         0   1037984   0% /dev/shm
/dev/sda8            185248244 170250636   5587536  97% /home
/dev/sda7               497829     10675    461452   3% /tmp
/dev/sda2             10317860   3032224   6761516  31% /usr
/dev/sda3             10317860   1479624   8314116  16% /var

[root@]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda6            1012M  190M  771M  20% /
/dev/sda1              99M   17M   78M  18% /boot
none                 1014M     0 1014M   0% /dev/shm
/dev/sda8             177G  163G  5.4G  97% /home
/dev/sda7             487M   11M  451M   3% /tmp
/dev/sda2             9.9G  2.9G  6.5G  31% /usr
/dev/sda3             9.9G  1.5G  8.0G  16% /var

The -h option stands for "human readable", so as you can see, my current Linux system has one filesystem, and it is mounted as / (the root filesystem), and it is a 10GB filesystem, with 5.5GB used, 4.6GB available, and it is 55% used (which is pretty easy to see with round numbers like this example).

 

 Step 1. Copy the following commands into Notepad

Echo ipconfig/flushdns
ipconfig/flushdns
echo ipconfig/release
ipconfig/release
echo ipconfig/renew
ipconfig/renew
exit

Step 2. Save the file to changeip.bat
Step 3. Run the file (double click on it)

If you try to run this on Vista you have to to right-click the shortcut for the file and choose ‘Run as Administrator’.

Important! This works only if you are using a dynamic allocated IP address.

 

C:\Documents and Settings\Administrator>ipconfig ?

 

Error: unrecongnized or incomplete command line.

 

USAGE:

    ipconfig [/? | /all | /renew [adapter] | /release [adapter] |

              /flushdns | /displaydns | /registerdns |

              /showclassid adapter |

              /setclassid adapter [classid] ]

 

where

    adapter         Connection name

                   (wildcard characters * and ? allowed, see examples)

 

    Options:

       /?           Display this help message

       /all         Display full configuration information.

       /release     Release the IP address for the specified adapter.

       /renew       Renew the IP address for the specified adapter.

       /flushdns    Purges the DNS Resolver cache.

       /registerdns Refreshes all DHCP leases and re-registers DNS names

       /displaydns  Display the contents of the DNS Resolver Cache.

       /showclassid Displays all the dhcp class IDs allowed for adapter.

       /setclassid  Modifies the dhcp class id.

 

The default is to display only the IP address, subnet mask and

default gateway for each adapter bound to TCP/IP.

 

For Release and Renew, if no adapter name is specified, then the IP address

leases for all adapters bound to TCP/IP will be released or renewed.

 

For Setclassid, if no ClassId is specified, then the ClassId is removed.

 

Examples:

    > ipconfig                   ... Show information.

    > ipconfig /all              ... Show detailed information

    > ipconfig /renew            ... renew all adapters

    > ipconfig /renew EL*        ... renew any connection that has its

                                     name starting with EL

    > ipconfig /release *Con*    ... release all matching connections,

                                     eg. "Local Area Connection 1" or

                                         "Local Area Connection 2"

 

C:\Documents and Settings\Administrator>

 

 

 

 NAME

       log, logf, logl - natural logarithmic function
 
SYNOPSIS
       #include
 
       double log(double x);
       float logf(float x);
       long double logl(long double x);
 
       Link with -lm.
 
DESCRIPTION
       The log() function returns the natural logarithm of x.
 
ERRORS
       The log() function can return the following errors:
 
       EDOM   The argument x is negative.
 
       ERANGE The argument x is zero.  The log of zero is not defined (minus infinity).
 
CONFORMING TO
       SVr4, 4.3BSD, C89.  The float and long double variants are C99 requirements.
 
SEE ALSO
       cbrt(3), clog(3), log1p(3), sqrt(3)
 

 Here's a crontab example that shows how to run a command from the cron daemon once every day

0 1 * * * /var/www/backup.sh

 

 

crontab: invalid option -- -

crontab: usage error: unrecognized option

usage:  crontab [-u user] file

        crontab [-u user] [ -e | -l | -r ]

                (default operation is replace, per 1003.2)

        -e      (edit user's crontab)

        -l      (list user's crontab)

        -r      (delete user's crontab)

        -i      (prompt before deleting user's crontab)

 

 

 About find

Finds one or more files assuming that you know their approximate filenames.

 

This command searches through the root filesystem ("/") for the file named "Chapter1". If it finds the file, it prints the location to the screen.

find / -name Chapter1 -type f -print

On Linux systems and modern Unix system you no longer need the -print option at the end of that command:

find / -name Chapter1 -type f

This command searches through the /usr and /home directories for the file named Chapter1:

find /usr /home -name Chapter1 -type f

To search in the current directory, and all subdirectories, just use the . character to reference the current directory, like this:

find . -name Chapter1 -type f

This next command searches through the /usr directory for all files that begin with the letters Chapter, followed by anything else. The filename can end with any other combination of characters. It will match filenames such as ChapterChapter1Chapter1.badChapter-in-life, etc.:

find /usr -name "Chapter*" -type f

This next command searches through the /usr/local directory for files that end with the extension.html. These file locations are then printed to the screen.

find /usr/local -name "*.html" -type f -print

Finding directories

Every option you just saw for working with files can also be used on directories. Just replace the -foption with a -d option. For instance, to find all directories named build under the current directory, use this command:

find . -type d -name build

Finding files that contain text

You can combine the find and grep commands to powerfully search for text strings in many files.

This next command shows how to find all files beneath the current directory that end with the extension.java, and contain the characters StringBuffer. The -l argument to the grep command tells it to just print the name of the file where a match is found, instead of printing all the matches themselves:

find . -type f -name "*.java" -exec grep -l StringBuffer {} \;

(Those last few characters are required any time you want to exec a command on the files that are found. I find it helpful to think of them as a placeholder for each file that is found.)

 

http://www.devdaily.com/unix/edu/examples/find.shtml

 

 

 For the processor info:
root # cat /proc/cpuinfo

 

[root@HCMRTG_BY_YaoBin html]# cat /proc/cpuinfo

processor       : 0

vendor_id       : GenuineIntel

cpu family      : 15

model           : 4

model name      : Intel(R) Xeon(TM) CPU 3.00GHz

stepping        : 10

cpu MHz         : 3000.370

cache size      : 2048 KB

physical id     : 0

siblings        : 2

core id         : 0

cpu cores       : 1

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 5

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid cx16 xtpr lahf_lm

bogomips        : 6003.78

 

processor       : 1

vendor_id       : GenuineIntel

cpu family      : 15

model           : 4

model name      : Intel(R) Xeon(TM) CPU 3.00GHz

stepping        : 10

cpu MHz         : 3000.370

cache size      : 2048 KB

physical id     : 0

siblings        : 2

core id         : 0

cpu cores       : 1

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 5

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid cx16 xtpr lahf_lm

bogomips        : 5999.40

 

processor       : 2

vendor_id       : GenuineIntel

cpu family      : 15

model           : 4

model name      : Intel(R) Xeon(TM) CPU 3.00GHz

stepping        : 10

cpu MHz         : 3000.370

cache size      : 2048 KB

physical id     : 3

siblings        : 2

core id         : 0

cpu cores       : 1

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 5

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid cx16 xtpr lahf_lm

bogomips        : 5999.43

 

processor       : 3

vendor_id       : GenuineIntel

cpu family      : 15

model           : 4

model name      : Intel(R) Xeon(TM) CPU 3.00GHz

stepping        : 10

cpu MHz         : 3000.370

cache size      : 2048 KB

physical id     : 3

siblings        : 2

core id         : 0

cpu cores       : 1

fdiv_bug        : no

hlt_bug         : no

f00f_bug        : no

coma_bug        : no

fpu             : yes

fpu_exception   : yes

cpuid level     : 5

wp              : yes

flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe lm constant_tsc pni monitor ds_cpl cid cx16 xtpr lahf_lm

bogomips        : 5999.47

 

 

 

Examples

mv myfile.txt newdirectory/ - moves the file myfile.txt to the directory newdirectory.

mv myfile.txt ../ - moves the file myfile.txt back one directory (if available).

 

 Usage: mv [OPTION]... SOURCE DEST

  or:  mv [OPTION]... SOURCE... DIRECTORY
  or:  mv [OPTION]... --target-directory=DIRECTORY SOURCE...
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
 
Mandatory arguments to long options are mandatory for short options too.
      --backup[=CONTROL]       make a backup of each existing destination file
  -b                           like --backup but does not accept an argument
  -f, --force                  do not prompt before overwriting
                                 (equivalent to --reply=yes)
  -i, --interactive            prompt before overwrite
                                 (equivalent to --reply=query)
      --reply={yes,no,query}   specify how to handle the prompt about an
                                 existing destination file
      --strip-trailing-slashes remove any trailing slashes from each SOURCE
                                 argument
  -S, --suffix=SUFFIX          override the usual backup suffix
      --target-directory=DIRECTORY  move all SOURCE arguments into DIRECTORY
  -u, --update                 move only when the SOURCE file is newer
                                 than the destination file or when the
                                 destination file is missing
  -v, --verbose                explain what is being done
      --help     display this help and exit
      --version  output version information and exit
 
The backup suffix is `~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX.
The version control method may be selected via the --backup option or through
the VERSION_CONTROL environment variable.  Here are the values:
 
  none, off       never make backups (even if --backup is given)
  numbered, t     make numbered backups
  existing, nil   numbered if numbered backups exist, simple otherwise
  simple, never   always make simple backups
 
 
  • «
  •  Start 
  •  Prev 
  •  1 
  •  2 
  •  3 
  •  4 
  •  Next 
  •  End 
  • »