How to delete directory on FTP server with curl? (linux, shell) - linux

How can I delete a directory, which contains several files and sub-directories, with curl using the cmd shell (bash, ubuntu)?
I only know the name of the folder I want to delete.
This is a new question. I don't want to delete a file, I want to delete a directory, where I don't know the content.

Related

How to add custom starting directory in WSL

[dawidn:/mnt/c/Users/dawin]$
This is my default shell directory, all of my projects are on partition d. Is there a way to make my shell start at a certain folder by default?
Edit the file ~/.bashrc
At the end of the file add the line:
cd /mnt/d/.....
Save an close the file.
On logging back into bash, you should have the specified directory as your initial current working directory.

How to recursively delete files and folders under a certain directory using command line?

I am a beginner of Linux system. Now I have a butch of files and folders want to be deleted. How can delete them one time using some command line?
Firstly I think you need rm command, then since you want to recursively delete the files or folders, you have to choose the option -r, -r means recursively delete something. Below is the link for details using rm command in Linux system.
https://www.computerhope.com/unix/urm.htm

rsync multiple files from multiple directories in linux

I have multiple directories named by date (ex: 2017-09-05) and inside those directories multiple log.gz files from BRO IDS. I am trying to enter each directory, and get only specific log.gz files by name, and send those to a remote system using rysnc. A log file looks like this:app_stats.00:00:00-01:00:00.log.gz I am attempting to use wildcards to accomplish this.
Ex: rsync -avh --ignore-existing -e ssh -r /home/data/logs/2017-09-* {dns,http}.*.log.gz / root#10.23.xx.xx:/home/pnlogs/
This is close, but its just copying all the files in each folder and ignoring my attempt at just getting http and dns logs as seen in the example. Is this possible to do in one line? Would I need multiple?

Create new TAR file in current directory to a new directory without using "mv" (shell script)

I'm currently setting up a backupmanager to automatically archive directories from webserver. I'm searching for an answer how to create a new TAR file of the current directory to a new (different) directory without using mv after the archiving process. See my command:
dcreate=$(date +%Y_%d_%m) tar -cvpzf backup_$dcreate.tar.gz plugins/folder_to_archive/
This command works fine, but i'm struggeling now on how to move it to a new directory directly after the archiv process is terminated, for example:
plugins/plugin_name/ to plugins/backups/
Any help appreciated.
Regards
The -f option of tar is the destination file for the archive; it can be anywhere you want, i.e., you can change
-cvpzf "backup_$dcreate.tar.gz"
to
-cvpzf "plugins/backups/backup_$dcreate.tar.gz"
if you want your new archive to be created in plugins/backups/

Using wget on a directory

I'm fairly new to shell and I'm trying to use wget to download a .zip file from one directory to another. The only file in the directory I am copying the file from is the .zip file. However when I use wget IP address/directory it downloads an index.html file instead of the .zip. Is there something I am missing to get it to download the .zip without having to explicitly state it?
wget is the utility to download file from web.
you have mentioned you want to copy from one directory to other. you meant it is on same server/node?
In that case you can simply use cp command
And if you want if from any other server/node [file transfer] you can use scp or ftp

Resources