Terminal How-To's

Related to Conda, Python, Terminal customization, Notes, Tips, Useful Commands

Useful Terminal Commands, Beyond the Very Basic

Processes currently running

I guess you can consider top and htop to be among the basic terminal commands. They show the top processes currently running on your computer. This blog post covers the basic Mac Terminal commands and customization https://scrimba.com/articles/web-developer-terminal/ and there are many others out there.

Remove and rename a folder or file

rm -rf to force delete a folder; and rm alone to remove files. Be careful with this one, you can't recover removed files or folders, they're premanently gone.   

mv moves or renames a file. cp copies the file.

Find files or keywords

To search for any keyword or phrase, you can add pip grep | grep KEYWORD to any command that prints text like cat or git log or pip freeze etc. If you want to find a sentence, add quotes around it e.g. cat log.txt | grep "Data Size"

find ,locate, mdfind are defaults in Mac see these answers https://superuser.com/questions/226566/how-do-i-find-a-file-by-filename-in-mac-osx-terminal but there are Homebrew tools to enhance finding or even listing folders and files in a directory, like https://formulae.brew.sh/formula/tree

Last updated