Function: Remove the directory and suffix of the file1. Remove the file path1 basename /backup/jenkins/ci/script/release. SH . bak 2 Release. sh. bak2. Remove the file suffix1 basename /backup/jenkins/ci/script/release. SH . bak. bak 2 Release. SH 3
This article describes the __file__, dirname and basename usages in PHP. Share to everyone for your reference. The specific methods are as follows:
__file__ the full path and filename of the current running file in PHP, if used in the included file,
In php, the complete path and FILE name of the current running FILE are _ FILE _. if it is used in the included FILE, the included FILE name is returned, this is a magic variable (a predefined constant). we can use dirname and basename to obtain the
$path = "/www/mywebsite/images/myphoto.jpg";1.pathinfo () functionThe PathInfo () function returns an array containing the file information, with four elements, dirname, basename, extension, and filename, respectively. Print the code for the
$path = "/www/mywebsite/images/myphoto.jpg";1.pathinfo () function
The pathinfo () function returns an array of file information containing four elements, namely, dirname, basename, extension, filename. To print the array code:
Mixed pathinfo
2,WC [-LWM]
Options and parameters:
-L: only list rows;
-W: How many words are listed(English word);
-M: The number of characters;
3,Md5sum
Md5sum [Option]... [file]...
Print or check MD5. (128-bit) checksums.
With no file, or whenFile
1. Function descriptionBaseNamePrints "name" after removing the leading directory path part from the file name path.If you specify a suffix, the trailing "suffix" is also removed.2. Usagebasename path name [suffix]basename options3. Options--HELP
We talked earlier about using the PHP pathinfo () function to return the file path information, the PHP dirname () function is the directory part of the return file path, this article mainly introduces the use of
php basename () functionReturns the
We all know that the pathinfo (), parse_url (), and basename () functions in PHP are URL-resolved functions, but there are also some differences. The following lists some examples, through examples, it is easier to understand the usage methods and
It is well known that in PHP functions PathInfo (), Parse_url (), and basename (), these three are the functions that parse the URL, but there are some differences, here are some examples, it is easier to understand the use of these three functions
1. Use _ FILE _ and dirname (_ FILE _) and basename (_ FILE:It is usually very effective to use dirname (_ FILE _) when configuring the FILE path, however, because the path of _ FILE _ is the complete path of the FILE where the current code is
PHP functions PathInfo (), Parse_url (), and basename (), these three are all functions that parse the URL, but there are some differences, this article lists some examples, hope that through these examples to help you understand the three functions
In a shell script, the $ A is typically used to display the name of the script, which displays the path name of the script when not using basenameFor exampleCat test5.sh #!/bin/bash # Testing the $ parameter echo the zero parameter is set
This article is mainly about the use of PHP functions pathinfo() , parse_url() and basename() parse the URL of the instance code, the following words do not say more directly to see the code
The instance code is as follows:
1, using PathInfo to
Php uses the pathinfo (), parse_url (), and basename () functions to parse the URL, pathinfobasename
This document describes how to use functions in php.pathinfo(),parse_url()Andbasename()The instance code for URL Parsing. Let's just look at the
Man , info, help, date, Hwclock, Cal, shutdown, reboot, Halt, Poweroff, type, CD, which, DirName, BaseName, who, which, Whatis, Makewhatis, Echo, hash, TTY tac:cat display the file file in reverse order ...: View the format of the contents of the
Several common small commands for viewing logged-in users:1, W : Displays the currently logged on user and what they are doing[Email protected] usr]# W10:02:06 up 2 days, 2:06, 1 user, Load average:0.00, 0.00, 0.00USER TTY from [email protected]
Directory management class commands for Linux commands: mkdir, rmdir, tree, DirName, basenamemkdir command: Create a new directorySyntax: mkdir [OPTION]/path/to/somewhereCommon parameter options:-P: Create parent Directory-V: Show creation
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.