Operation and Maintenance
Linux Operation and Maintenance
Log in to ftp under linux, detailed explanation of lftp commandLog in to ftp under linux, detailed explanation of lftp command
Use lftp
1. Log in to ftp
Code:
lftp Username: Password@ftp address: Transfer port (default 21)
Usage
(1)lftp username:password@127.0.0.1:21 Enter
(2)lftp username@127.0.0.1 Enter ##Default port 21 Enter password after entering
(3)lftp 127.0.0.1 Enter ##Enter and log in
(4)lftp Enter--> open 127.0.0.1 --> login Login
I feel a lot like Kong Yiji. There are several ways to write "fennel" in fennel beans! ~So dizzy~
2. lftp Chinese garbled code problem
For a novice like me, after logging in, all I see is Chinese garbled code (because generally the local encoding is utf-8) ), why not, use the set command to solve it
set ftp:charset gbk (or gb2312 or utf-8) ##Set the encoding format of the ftp end
set file:charset utf-8 (...Same as above) ##Set the local encoding format
Attachment: Tips for the set command (1) Enter set to view the set commands (2) set -a to view all the commands that can be set
3. Find ftp side files
ls *.txt ##Find all txt files in the current directory
ls ./123/ ##List all files in the 123 directory
find . -name "*.txt" ##Recursively search for all txt files on the site
find ./xx -name "*.txt" ##Find all txt files in the xx directory File
Attachment 1: The second time ls reads is the local cache, you can use rels instead of ls or catch off / catch on to switch catch, catch flush clears the local catch
Attachment 2: You can use !ls to browse local directories, such as !ls /usr/local/bin/
4. Download files
Before downloading files, you must first set up a local directory to store downloads. File
lcd /home/123/web ##Set the local storage directory to /home/usr by default
get 123.txt ##Download the 123.txt file to /home/123/ In web
get -c 123.txt ##Resumable download
mget *.txt ##Batch download all txt files
mget -c *.txt ##Resume breakpoint transmission
mget -c ./123/aaa/*.txt ##Resume breakpoint transmission, batch download all txt files in the aaa directory on the ftp end
pget - c -n 10 file.dat
##Download file.dat
##with up to 10 threads allowing resumed downloading
##Can be set by set pget:default-n 5 value and use the default value.
mirror aaa/
##Download the entire aaa directory, and the subdirectories will be automatically copied to the local directory and automatically created
5. Upload files
put 123.txt ##Same as download
mput *.txt ##Same as download
mirror -R aaa/ ##Same as download
6. Set passive/non Passive mode
set ftp:passive-mode 1 ## 1 passive 0 non-active
Multi-tasking
ctrl+z ##Transfer the current task to the background for processing
wait ##Move background processing tasks to the foreground to view
jobs ##View the list of tasks performed in the background
kill all or job_no ##Delete all tasks or the specified Task
##Add task to task list
queue get 123.txt
queue put 234.txt
queue mirror aaa/
queue ##View task list
jobs ##View background task list
queue start ##Start task list
queue stop ##Stop task list
Other commands
alias []
Define alias
alias less more
alias reconnect "close; cd ."
Enter alias directly to see which aliases are currently defined. If you only enter alias name, the alias name will be cancelled.
bookmark SUBCMD
Set bookmarks. You can set the current site and directory as bookmarks. You can enter directly next time without having to cd back and forth.
bookmark add name is used to add a bookmark named name
bookmark del name Delete the bookmark named name
bookmark list Displays the currently set bookmarks (in addition, directly type the results of bookmark and bookmark list) Same)
bookmark edit Call the editor to modify bookmarks (~/.lftp/bookmarks)
cd Switch remote directory
cache SUBCMD
Manage lftp cache
rels []
Display remote file list from cache
rels will not be read from cache
recls opts [path /]pattern
Displays the remote file list from the cache. It should be regarded as an enhanced version of ls. There are many parameters available. It should be used to generate various file lists for use by other programs.
recls will not be read from the cache
du options
Calculate the capacity occupied by the entire remote directory
get OPTS -o
Grab remote files
get rfile -o lfile
Grab rfile and rename it locally to lfile
-c for resume transfer
-E After the file grabbing is completed, cut the remote files
-a to ascii mode, the default is binary mode
-O Set the base directory to the local directory where the files are placed
mget OPTS
Download remote files (wildcard expansion is available, that is, *)
pget OPTS -o
Use multiple links to download files, default for five.
-n 3 For three links
jobs -v
Display which programs are currently running in the background
-v Display detailed information (- v You can add a few more to display more detailed information)
lcd
Switch the local directory
mirror OPTS remote [local]
###Download the entire directory (The get upstairs can only be used to grab files)###-c Resume
-e Be careful with this. Compare the remote and local files. If the remote files are not available, delete the local files, that is, combine the local and remote data. Synchronize.
-R Upload the entire directory
-n Download only newer files
-r No need to pass back to the directory
--parallel=n Download n files at the same time (default is to download only one at a time)
module name args
Load module
put OPTS -o
Upload file
mput OPTS
Upload files (wildcard expansion can be used, that is, *)
mv
Rename the remote file1 to file2
mrm
Use wildcard expansion to delete remote files
open OPTS
Open a site
open -u, -p site
queue OPTS []
Put cmd in the queue and wait for execution
-d index Delete the job numbered index
-m index new_index Will The job numbered index is moved to number new_index, which is only used for queue jumping.
-n index Add a new job before the number index
wait []
Move the program executing in the background to the foreground (fg can also be used)
kill all|
Delete all jobs or job_no
repeat delay command
Repeat command every delay seconds, the default is every second
rm -r -f
Remove remote files
mkdir -p
Create remote directory
rmdir -f
Remove the remote directory
set OPT []
Set variables
Type set directly to see which variables are currently defined
source
Read file and execute the command in file (it should be the same as the source command in bash)
debug [|off] -o
Set Set the debug level to level
-o and direct the output to file
exit [|bg]
End lftp
If there are still jobs at this time, Then lftp will be executed in the background and continue the unfinished work
history -w file-r file-c|-l cnt
The function is the same as the history in bash
renlist []
Only display the remote file name
pwd -p
Display the current remote directory
-p even with the login password Also displays
scache []
Only scache shows all current sessions, plus session_no can switch to other sessions,
For opening multiple sites at the same time or Switch between different directories on the same site.
The above is the detailed content of Log in to ftp under linux, detailed explanation of lftp command. For more information, please follow other related articles on the PHP Chinese website!
Linux's Essential Components: Explained for BeginnersApr 17, 2025 am 12:08 AMThe core components of Linux include the kernel, file system, shell and common tools. 1. The kernel manages hardware resources and provides basic services. 2. The file system organizes and stores data. 3. Shell is the interface for users to interact with the system. 4. Common tools help complete daily tasks.
Linux: A Look at Its Fundamental StructureApr 16, 2025 am 12:01 AMThe basic structure of Linux includes the kernel, file system, and shell. 1) Kernel management hardware resources and use uname-r to view the version. 2) The EXT4 file system supports large files and logs and is created using mkfs.ext4. 3) Shell provides command line interaction such as Bash, and lists files using ls-l.
Linux Operations: System Administration and MaintenanceApr 15, 2025 am 12:10 AMThe key steps in Linux system management and maintenance include: 1) Master the basic knowledge, such as file system structure and user management; 2) Carry out system monitoring and resource management, use top, htop and other tools; 3) Use system logs to troubleshoot, use journalctl and other tools; 4) Write automated scripts and task scheduling, use cron tools; 5) implement security management and protection, configure firewalls through iptables; 6) Carry out performance optimization and best practices, adjust kernel parameters and develop good habits.
Understanding Linux's Maintenance Mode: The EssentialsApr 14, 2025 am 12:04 AMLinux maintenance mode is entered by adding init=/bin/bash or single parameters at startup. 1. Enter maintenance mode: Edit the GRUB menu and add startup parameters. 2. Remount the file system to read and write mode: mount-oremount,rw/. 3. Repair the file system: Use the fsck command, such as fsck/dev/sda1. 4. Back up the data and operate with caution to avoid data loss.
How Debian improves Hadoop data processing speedApr 13, 2025 am 11:54 AMThis article discusses how to improve Hadoop data processing efficiency on Debian systems. Optimization strategies cover hardware upgrades, operating system parameter adjustments, Hadoop configuration modifications, and the use of efficient algorithms and tools. 1. Hardware resource strengthening ensures that all nodes have consistent hardware configurations, especially paying attention to CPU, memory and network equipment performance. Choosing high-performance hardware components is essential to improve overall processing speed. 2. Operating system tunes file descriptors and network connections: Modify the /etc/security/limits.conf file to increase the upper limit of file descriptors and network connections allowed to be opened at the same time by the system. JVM parameter adjustment: Adjust in hadoop-env.sh file
How to learn Debian syslogApr 13, 2025 am 11:51 AMThis guide will guide you to learn how to use Syslog in Debian systems. Syslog is a key service in Linux systems for logging system and application log messages. It helps administrators monitor and analyze system activity to quickly identify and resolve problems. 1. Basic knowledge of Syslog The core functions of Syslog include: centrally collecting and managing log messages; supporting multiple log output formats and target locations (such as files or networks); providing real-time log viewing and filtering functions. 2. Install and configure Syslog (using Rsyslog) The Debian system uses Rsyslog by default. You can install it with the following command: sudoaptupdatesud
How to choose Hadoop version in DebianApr 13, 2025 am 11:48 AMWhen choosing a Hadoop version suitable for Debian system, the following key factors need to be considered: 1. Stability and long-term support: For users who pursue stability and security, it is recommended to choose a Debian stable version, such as Debian11 (Bullseye). This version has been fully tested and has a support cycle of up to five years, which can ensure the stable operation of the system. 2. Package update speed: If you need to use the latest Hadoop features and features, you can consider Debian's unstable version (Sid). However, it should be noted that unstable versions may have compatibility issues and stability risks. 3. Community support and resources: Debian has huge community support, which can provide rich documentation and
TigerVNC share file method on DebianApr 13, 2025 am 11:45 AMThis article describes how to use TigerVNC to share files on Debian systems. You need to install the TigerVNC server first and then configure it. 1. Install the TigerVNC server and open the terminal. Update the software package list: sudoaptupdate to install TigerVNC server: sudoaptinstalltigervnc-standalone-servertigervnc-common 2. Configure TigerVNC server to set VNC server password: vncpasswd Start VNC server: vncserver:1-localhostno


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Zend Studio 13.0.1
Powerful PHP integrated development environment

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment





