

To search for files with words, pie and 2016 anywhere in the file name, do spot pie*2016 #or Now, either source ~/.bash_aliases or open a new terminal load functions. Open "$(mdfind -name -onlyin "/Users/foo/articles" "kMDItemDisplayName='*$1*'cd" | sed -n "$")" # default to open the first entry unless 2nd positional argument is given Mdfind -onlyin "/Users/foo/articles" "kMDItemDisplayName='*$1*'cd"

# restrict to files under (recursive) a specific path # find any item matching search query in file name I find this easier than typing long string of query in spotlight window.Īdd following functions in ~/.bash_aliases. Output where some history is stored: cat ~/.You may use following command line functions to quickly find and open relevant file. Run the source command can be used to load any functions file into the current shell script or a command prompt. Modify history environment variables, set to a value: export HISTFILESIZE=1000 Otherwise, the overwritten alternative proceeds. You may use also histappend to append history, If the histappend shell option is turned on lines are appended to the history file. The reason is that the history file is overwritten with the HISTSIZE unless using histappend option turned ON. If the set HISTFILESIZE is determined to be a large value than what HISTSIZE is set, you will not view history larger than your set HISTSIZE. HISTSIZE will determine specifically how many lines will be stored or in other words, written at the end of the session. HISTFILESIZE will only set a maximum history value which is stored to the history file when a session is started.

It is possible to achieve this by modifying ~/.bash_profile, the number placeholder with SIZE represent's the number, lines value as example: export HISTFILESIZE=SIZE # Example 1000 You may achieve this through HISTSIZE and HISTFILESIZE environment variables which are located in your ~/.bash_profile file. Note: You may also increase your command history storage size in the length of two variables. HISTFILESIZE Determines how long the file.

HISTSIZE Determines how many lines will be written to the history file.
