Mac OS uses alias commands for ls such as ll, la, etc.

If you are used to using ls aliases such as ll and la under linux, it will be frustrating to go to mac os. In fact, just create a script ".bash_profile" in the user directory and enter the following:

 

alias ll='ls -alF'

alias la='ls -A'

alias l='ls -CF'

Then

source .bash_profile

 

Summary of knowledge points:

1. The .bash_profile file is a file that is automatically executed when the user logs in to the terminal. Generally, .bashrc is called in this file (that is, there is such a line in .bash_profile: source ~/.bashrc ), of course, provided that these files exist And set it up, you can Baidu for details.

source command usage : (not tested, but it can help us understand something)
source FileName
function: read and execute the commands in FileName in the current bash environment.
Note: This command is usually replaced with the command ".".
Such as: source .bash_rc is equivalent to . .bash_rc.
Note: The difference between the source command and shell scripts is that
source executes the command in the current bash environment, while scripts start a subshell to execute the command. In this way, if the command for setting environment variables (or alias, etc.) is written into scripts, it will only affect the subshell and cannot change the current BASH. Therefore, when setting environment variables through a file (command line) , use the source command.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326846861&siteId=291194637