Xcode statisticsCodeIt is very simple to use shell commands. Open the terminal, enter your project directory, and execute the following code
Find.-Name "*. m"-or-name "*. H"-or-name "*. html"-or-name"*. C" | xargs WC-l
To collect statistics on
Basename is the name left after the directory is removed.Example: shell> temp =/home/temp/1. TestShell> base = 'basename $ temp '(reverse quotation marks)Shell> echo $ BaseResult: 1. TestDirname is the DirectoryExample: shell> temp =/home/temp/1.
1. String Truncation
(1) intercept the string before and after a specified character
[Root @ gd86 applications] # Var = Hello: zkl: zyh
[Root @ gd86 applications] # echo $ {var %: *} returns the first string from right to left.Hello: zkl[Root @
Difference between $ * and $ @ in Shell
A little bit about $ * and $ @ is also learned by cainiao.
$ *All location parameters are used as a word.Note: "$ *" must be referenced.$ @It is synonymous with $ *, but each parameter is an independent ""
I wrote this article before.ArticleHowever, this log is missing due to the previous data loss fault. So I re-wrote this script and posted it again to everyone.
#! /Bin/bashlogs_path =/home/logs/www/arch_log_path =$ {logs_path} $ (date-d "yesterday"
Obtain UNIX options: one advantage of UNIX is that standard Unix commands have the same command line format during execution: Command-options parameters. If the shell program is executed in the preceding format, the Bourne shell provides a statement
It has the most basic mathematical computing capabilities in shell, such as expr and let. However, these operations can only process integer data. To calculate decimals, you must use the BC command extension. The following example shows how to
Unix shell programming (4)
Cut commandYou can extract the required data fields from the data file or command output.Command Format: Cut-cchars FileChars indicates the characters to intercept, which can be numbers.File indicates a file. If file is
This article summarizes some of my frequently used shell commands or some short commands.
1. view the compile time of a tool;
ll $(which appname)
2. Common for Loops
for i in 1 2 3 4 5; do echo "$i"; done;
for((i=140;i
3. Commonly Used File
Term: freexploit
Author: allyesno
Date: 2005-06-21
Codz:
@ Echo off: Ncfoever 1.0 bulid by allyesno: Can be used to capture TCP port data packetsCLS:/* Parameter judgment and usage instructions */Set COUNT = 1If/I "% 1" = "-Look" Goto
1. Using securitycrt in the options-> session Options dialog box, there are many options for emulation under terminal. the Linux server has different terminal simulation packages called the terminfo database, each type corresponds to a terminfo File
Linux scripts are huge and powerful.
Definition:
Function Name () // function can be omitted
{
Command
}
Call: directly use the function name in the script. Of course, you can also include parameters such
Function Name parameters (separated by
[-A file] true if the file exists.
[-B file] If the file exists and is a special block file, it is true.
[-C file] If the file exists and is a special word file, it is true.
Device Files: block device files with a single character. The unit of
Shell is a program that interfaces between users and Linux systems. It allows users to input the commands to be executed to the operating system. Many powerful functions can be implemented through shell.
1. Redirection
File descriptor: 0 indicates
Here, I will first introduce what a shell is, then introduce my first shell program and the lessons learned from it.
I. What is shell?Before talking about my shell program, I 'd like to tell you what shell is. I believe you have heard a lot about
1 shell $! , $ ?, $, $ @
• $ N $1 the first parameter, $2 the second...• $ # The number of command-line parameters.• $0 the name of current program.• $? Last Command or function's return value.• $ The program's PID.• $! Last program's PID.• $ @
"Hello World" shell scriptBased on the traditional program teaching example, we will introduce how to write shell script "Hello World.
--------------------------------------------------------------------------------
#! /Bin/sh# Filename: HelloEcho
Instance
General programming steps
Now let's discuss the general steps for writing a script. Any excellent script should have help and input parameters. And write a pseudo script (framework. sh) that contains the framework structure required by
This article is one of the seventh chapter Input/Output and Command-Line Processing of Learning the bash Shell 3rd Edition. We have learned the basic IO redirection operations of shell:>,
Cmd1|Cmd2: Pipe, SetCmd1Standard outputCmd2Standard
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