A shell command script every day

Source: Internet
Author: User
Tags file permissions

List of files and directories
The most basic form of the LS command displays files and directories under the Pro directory

The table of contents and files will display color distinctions.
If the terminal is not supported in color, you can add the-F option to the directory with a forward slash/

Ls-a shows hidden files, hidden files on Linux are files with the file name starting with the dot. There are three files for each user's home directory. Bash starts with a file
/etc/profile: This file sets the environment information for each user of the system, and the file is executed the first time the user logs on. and collects the shell settings from the configuration file of the/ETC/PROFILE.D directory.
/ETC/BASHRC: Executes this file for each user running the bash shell. When the bash shell is opened, the file is read.
~/.bash_profile: Each user can use this file to enter shell information dedicated to their own use, when the user logs on, the file is only executed once! By default, he sets some environment variables to execute the user's. bashrc file.
~/.BASHRC: This file contains bash information dedicated to your bash shell, which is read when you log in and every time you open a new shell. This file is for a specific user, if you need to set an environment variable for a user, you only need to modify the. bashrc file in the home directory of their individual users.
~/.bash_logout: Executes the file each time it exits the system (exiting the bash shell).
Variables set in/etc/profile (global) can be applied to any user, while variables set in ~/.BASHRC and so on (local) can only inherit variables from/etc/profile, they are "parent-child" relationships.

Ls-r recursion. You can list files in subdirectories that are contained in the current directory

Ls-l Options Show long list

The long list displays the following information
File types: such as directory (d), file (-), character file (c), block device (b)
File permissions rwx read and write execution
Total number of hard links to files
The owner name of the file
Group name of the genus Group of the file
Size of File
File name or directory name
Wildcard Filter Output list
Say hello (?) ) Represents a character

An asterisk (*) represents 0 or more characters

[] Bracket Matching

[! ] An exclamation mark sends out unwanted content.
Ls-t sort the latest modification time sort


Directory under AGF.4, AFD02,A1.TXT,BCATT,BD1TX file day01,day02,day03 three directories please find a file or directory that does not start with the letter A, not a file or directory ending in 1, find the first letter with a and the second letter is any , the third letter A-Z, the fourth character arbitrarily, five alphanumeric-between 0-3 or a-d
#/bin/bash
Ls-l
Ls-l [!a]*

Ls-l *[!1]

A shell command script every day

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.