Count the number of files in a folderLs-l | grep "^-" | wc-lCount the number of directories in a folderLs-l | grep "^ d" | wc-lCount the number of files in the folder, includingLs-lR | grep "^-" | wc-LFor example, to count all js files under
The find command in linux is used to find files. man find can be used to find files that are omnipotent. Therefore, simply find the file according to the file size. Search for the size from man find. The following information is displayed:
-Size n [
Use a client tool, such as securecrt, to connect to a linux server. Some of them may be disconnected after a period of time without any operation. This is mainly because the vro and firewall exist between the client and the server, and the idle
Basic rsync command syntaxRsync Command Option source directory target directory
If the source directory is/var/www/, all the files in the directory will be synchronized to the target directory. If it is/var/www /*, the hidden file in the current
Common Linux operating system logon files include the following:1)/var/log/secure: The file used to log on to the system to access data;For example, pop3, ssh, telnet, and ftp are all recorded here.
2)/ar/log/wtmp: records the logon information,
We all know that the linux system has extremely powerful functions, but sometimes the functions are not necessarily what we want, in some cases, we want a simple system that consumes less resources and runs some basic functions and commands. At this
In linux, TCP Connections cannot be released for a long time, such as the FIN_WAIT1 and FIN_WAIT2 statuses. The release time is uncertain and the corresponding program has been closed, and the corresponding ports are no longer monitored, it cannot
I. Overview of inter-process communicationProcess Communication has the following purposes:A. Data Transmission: A process needs to send its data to another process. The data volume sent is between one byte and several Mb.B. Shared data: if multiple
This section describes how to automatically start SVN when Linux is started. In the previous section, we will explain how to automatically start the SVN service when Windows is started. Through this section, you can make a comparison, let's take a
Alias command
Function Description: Some commands that we often use but are very long at system management. Then we can create an alias for these long strings of commands. This long string of commands can be directly replaced by an alias. The system
For system administrators or programmers, grep is probably the most popular tool when they need to search for specific text or patterns in a directory with complex configurations or in a large source code tree.
If grep is one of your favorite tools,
I. IntroductionLVM is short for Logical Volume Manager. It is a mechanism for managing disk partitions in Linux, LVM is a logical layer built on hard disks and partitions to improve the flexibility of disk partition management. LVM is a logical
#! /Bin/sh
# Set Variables
Bak_path =/root/bak_linux
Date = $ (date + % Y % m % d)
Log_file = $ bak_path/$ date # log. log
# Write the execution result to the log
Exec 1> $ log_file 2> & 1
# Package the directory to be backed up in the $
When I log on to the server through ssh, frequent delays may occur. When I log on to the firewall, I find that the external network port of the firewall has reached 800 M/s. After checking, I find that the traffic on one server is very high. The
In linux system management, we sometimes need to end all processes of a user. Beginners usually first query all the user's PIDs, and then kill them one by one, or write a script. In fact, there are many methods to end. The bloggers summarize the
Attach a disk named hda2 to ount/dev/hda2/mnt/hda2-confirm the directory '/mnt/hda2' already existsUmount/dev/hda2 detach a disk named hda2-first exit from the mount point '/mnt/hda2'Fuser-km/mnt/hda2 force uninstall when the device is
Recently, the system was found to be very slow, so we were preparing to change the domestic yum source.
Prepare, first back up/etc/yum. repos. d/CentOS-Base.repoCd/etc/yum. repos. d/
Wgethttp: // mirrors.163.com/.help/CentOS6-Base-163.repo
Change
Open ports 80 and 3306
Vim/etc/sysconfig/iptables Add the following code under the rule of port 22 by default (you can continue to add and modify the port number) #/sbin/iptables-I input-p tcp -- dport 80-j ACCEPT #/sbin/iptables-I INPUT-p tcp --
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service