Linux how to count the current directory under the number of files, and how many directories?
Write a script with the shell below, put it in the current directory, and execute it.
Copy Code code as follows:
#!/bin/bash
#脚本名称
Instance: Lists all files (/s/b) under the current directory and subdirectories, excluding folders (/A:A)Dir/s/b/a:a
The following information is for reference only
dir--Display Disk Directory command1. Features: Displays the contents of the disk
Window ' *************************************************
' File:CurrentDir.vbs (WSH sample in VBScript)
' Autor: (c) G. Born
'
' Retrieving the current directory
'*************************************************
Option Explicit
WScript.Echo
When it comes to path-related issues, everyone will go to the window.location and think that this object provides quite a lot of path information, which is commonly used to include:
Location.href: Full URL of the current pageLocation.pathname: path
'*************************************************
' File:CurrentDir.vbs (WSH sample in VBScript)
' Autor: (c) G. Born
'
' Retrieving the current directory
'*************************************************
Option Explicit
WScript.Echo "Script Path:"
VBS gets the names of all folders under the current directory, excluding subfolders. I want to work with each folder, so it's best to use the loop output.
When testing to ensure that there is a folder in the current directory can be, otherwise
Dir.bat
Copy Code code as follows:
@rem This bat filename must not be "tree.bat", otherwise the tree command will be effective, do not know why
@rem may be because the system directory has "Tree.com", the system will be confusing it.
@rem
Requirements:When we develop command-line-related operations using Git, one of the most common repeats is when we open the command line and then go to the project's folder with the CD command (each time the input path is troublesome), and then
The file parameter is actually a directory that reports all the files in that directory. If the file parameter is not provided, the DU command uses the files in the current directory.If the file parameter is a directory, then the number of reported
Using the Unix/linux system UUID file to intercept the partial generation of random numbers, and in order to prevent the renaming process may already exist and the new random directory with the same name of a sub-directory, that is, the renaming
This article describes the JSP to obtain the current directory implementation methods, share for everyone to reference. The implementation methods are as follows:
1, using the System.getproperty () function to get the current path:
Copy Code
[Go] Original address: http://blog.csdn.net/liuweiyuxiang/article/details/71154346Gets the path to the current file: from Import Path = Path.dirname (__file__) # returns the directory where the current file is located # __file__ is the
When it comes to path-related issues, everyone will go to the window.location and think that this object provides quite a lot of path information, which is commonly used to include:
1.location.href: Full URL of the current page2.location.pathname:
To put it simply.
%cd% is the directory that gets the execution script
%~dp0 is where to get the script, the directory
The following example can be a good illustration of the problem
The contents of the F:\bin\test.bat script are as follows
@ Echo offEcho current drive letter: % ~ D0Echo current drive letter and Path: % ~ Dp0Echo full path of current batch processing: % ~ F0Echo short file name format of the current drive letter and Path: % ~ Sdp0Echo current cmd default directory: %
This article mainly introduces Python to obtain the current directory and the implementation of the parent directory, the need for friends can refer to the following
Gets the path to the current file:
From OS import path d = path.dirname
When running with administrator privileges in a batch, the system considers the current path to be C:\Windows\System32When installed with non-administrator privileges, the system will assume that the current path is the path to which the batch file
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.