Linux file on the download page folder and delete files

 

wget -nd -r -l1 --no-parent http://www.cs.virginia.edu/stream/FTP/Code/

 

Note: -nd not create directories; -r recursive download; download only the files in the current directory -l1; -no-parent does not download files parent directory.

 

Download stream when using the following command

 

wget  -r  --no-parent http://www.cs.virginia.edu/stream/FTP/Code/

Want to download all the code in the Code directory. -No-parent does not download files parent directory or the whole site data will be downloaded.

 

After downloading there will be many index files.

find . -name “*index*” | xargs rm -f

 

Can be operated through a pipe command, first find the file you want to delete your home directory, and then run the command "xargs" The constructor parameter list.

 

 

xargs - build and execute command lines from standard input

 

When using find -exec command options to deal with the matching file, find the command passed along to all matching files to execute exec. However, some systems have limitations on the length of the command can be transmitted to the exec, so after the find command to run a few minutes, an overflow error occurs. Error message is usually "argument list too long" or "parameter column overflow." This is useful where the xargs command, especially when combined with the find command.

 

find command to match the file transfer command to the xargs, and xargs command each get only part of the file, but not all, unlike the -exec option that. So that it can first deal with the first part of the file retrieved, and then the next batch, and so continue.

 

In some systems, using -exec option to process each matching file to initiate a corresponding process is not matched to the file all at once executed as a parameter; so in some cases there will be too many processes, system performance degradation problems, which is not efficient;

 

The xargs command using only one process. In addition, when using the xargs command, whether it is the time to get all the parameters, or in batches to obtain parameters, acquisition parameters and the number of each of the options will be determined based on the command and the corresponding kernel tunable parameters.

 

use the find command with exec and xargs allows users to perform almost all of the command to match the file.

 

Guess you like

Origin www.cnblogs.com/idyllcheung/p/11281535.html