Image by author
As a data professional, I understand the importance of being efficient and accurate in the workplace. That's why I believe that mastering the command line is an essential skill to optimize data analysis tasks and improve productivity. It is equally important for regular users who want to optimize the use of their operating system and automate various tasks.
In this blog, we will review a popular (144k?) one-page guide available on GitHub. The guide is designed to give you essential command line skills that can improve your workflow.
The command line (CLI), also known as a terminal or console, is a text-based interface that allows users to interact with a computer's operating system by using typed commands. It offers an alternative to graphical user interfaces (GUIs) and provides a more direct and precise way to access and manipulate files, directories, and system resources.
Screenshot by author
Users can enter commands into a terminal that allows them to perform tasks with precision and automation, such as scripting, software development, data processing, and systems administration. The terminal allows users to execute multiple complex operations with a single command.
Mastering the art of the command line It is a journey that can significantly improve your productivity and understanding of your computer system. Whether you're a beginner or an experienced user, the command line offers a powerful way to navigate, customize, and automate tasks on your computer.
It is particularly beneficial for data scientists. Through the command line, data professionals can optimize data cleansing, run data pipelines, automate data-related tasks, and use various command-line tools for testing and model development.
Screenshot of jlevy/the-art-of-the-command-line
This guide aims to provide essential command line knowledge on a single page, focusing on Linux but also including tools for macOS and Windows users. Covers basic commands, file and data processing, system debugging, and commands only available on Mac and Windows. The guide is available in several languages, thanks to the contributions of several authors and translators.
Languages: Chinese ∙ German ∙ Portuguese ∙ English ∙ Spanish ∙ French ∙ Indonesian ∙ Italian ∙ Polish ∙ Portuguese ∙ Romanian ∙ Swedish ∙ Slovenian ∙ Swedish ∙ Slovenian ∙ Swedish
The scope of this guide is broad but concise, and aims to cover everything important, provide specific examples, and avoid unnecessary details. It is designed for interactive use of Bash, but many tips apply to other Bash shells and scripts as well.
The essential
It is essential to learn basic Bash commands and understand its man documentation. ` and master at least one text-based editor (e.g. Vim, Emacs, nano) for efficient terminal-based editing. Additionally, it is important to learn about file and result manipulation, including redirection (>, <, |) and file grouping.
Daily use
To complete history and commands efficiently, use Tab and Ctrl-R, respectively. To navigate and manage files, understand directory navigation using ls, cd, ln, chmod, and chown.
File and data processing
Learn how to use text processing tools: grep, awk, sed, cut, sort, uniq and wc. To find files, learn how to use find and locate to locate files and directories.
System debugging
Familiarize yourself with system debugging and monitoring tools such as top, ps, netstat, dmesg, and iotop. Use strace, ltrace, and system logs for performance analysis and problem diagnosis.
clever phrases
One-liners are powerful scripts that perform complex tasks quickly. Examples include sorting and counting occurrences in text files, batch renaming, and system monitoring.
Batch rename script to change .txt to .md for all files in a directory:
for file in *.txt; do mv "$file" "${file%.txt}.md"; done
Dark but useful
Specialized commands such as expr, cal, yes, env, and printenv provide useful functionality for specific scenarios.
MacOS only
Mac users have access to unique tools such as Homebrew for package management, pbcopy and pbpaste for clipboard interaction, and file and system-specific utilities (mdfind, mdls).
windows only
Windows users can turn to Cygwin, Windows Subsystem for Linux (WSL), or MinGW for Unix-like command line environments. Tools like wmic, ipconfig, and PowerShell scripts extend the capabilities of the command line in Windows.
fun commands
Using tools like curl, egrep, tr, and cowsay, you can creatively search, process, and display information, showing the power and flexibility at your fingertips.
This guide is a useful cheat sheet for learning about new CLI tools and their applications in various scenarios. It is actively maintained and you can even contribute to the project by creating a pull request. He Master the art of the command line The guide is made by the community and for the community, so if you find any errors or learn something new that is missing, please update the main README.md file.
I hope you learn about new tools and utilities from this guide and apply them to your projects. In my experience, I have used more command line tools than actual Python code for data projects, especially if you are a data engineer or MLOps engineer.
Read more
Abid Ali Awan (@1abidaliawan) is a certified professional data scientist who loves building machine learning models. Currently, he focuses on content creation and writing technical blogs on data science and machine learning technologies. Abid has a Master's degree in technology Management and a Bachelor's degree in Telecommunications Engineering. His vision is to build an artificial intelligence product using a graph neural network for students struggling with mental illness.