Code

Must-read: 7 fresh articles about working in the command line

Must-read: 7 fresh articles about working in the command line

Learn: Linux OS Administration

Learn More

5 Cool Command Line Tools

Reading helps you master the tools that make your work more enjoyable and efficient. These resources can significantly simplify your tasks and increase your productivity. By learning new approaches and technologies, you can optimize your workflows and achieve better results.

You can read more on the Progress Story website.

We have prepared an article dedicated to useful command line tools. In it, you will find installation instructions for each tool, examples of useful functions, and comparisons with similar solutions. This information will help you expand your toolbox and improve your command line efficiency.

  • Bpython is a lightweight interpreter for Python. It adds several IDE features, such as auto-completion and auto-indentation. Bpython is superior to Ipython in terms of usability and efficiency.
  • Fish Shell is a great Bash-based command shell. Among other things, it features syntax highlighting, and its autocompletion feature is head and shoulders above the popular Zsh.
  • PGcli is a Postgres client with smart autocompletion and syntax highlighting. There are versions for MySQL and SQLite.
  • Tig is a text-based interface for Git, built on ncurses.
  • Awless is a command-line interface for working with Amazon Web Services. Essentially, it is a minimalist version of awscli with simplified and more concise commands.

How to automate service deployment using Bash scripts

Reading this material will help you master the basics of Bash scripts and learn how to use them to automate everyday tasks. Bash scripts are a powerful tool that can simplify routine operations, increase work efficiency, and reduce the time spent on repetitive tasks. Understanding the principles of writing and using Bash scripts will open up new opportunities to optimize your processes and increase productivity.

Read more on the DEV platform, which offers a wealth of materials for developers and IT professionals. DEV offers a variety of articles, blogs, and discussions, making it an excellent resource for sharing experiences and gaining new knowledge in technology and programming.

Developers often find themselves performing the same operations repeatedly. If you notice that you regularly repeat certain actions, consider automating them. This will not only speed up your workflow but also make your work more efficient and enjoyable. Automating routine tasks allows you to focus on the more complex and creative aspects of development, which in turn increases productivity and the quality of the final product.

The author of this article has experience working with the Spring Boot and React frameworks. Each time he updated the service, he had to manually check all the folders, terminate the old version, launch the new one, and test their correctness. To simplify this process, he decided to automate it. The most effective solution turned out to be using Bash scripts to automate all the necessary steps of the service update. This significantly reduced the time and effort spent on manual operations and increased overall work efficiency.

Bash scripts are files containing a sequence of commands to be executed in the Bash shell command line, which is standard for UNIX-based operating systems. Bash, short for "Bourne Again SHell," provides a powerful tool for automating tasks and managing system processes. Scripts allow users to simplify routine operations by combining various commands and creating complex scenarios. Using Bash scripts significantly improves system efficiency, allowing you to complete tasks faster and with less effort. Automating processes significantly simplifies server operations. Let's look at an example of server authorization: instead of manually entering each command, we can use a Bash script. This allows us to collect all the necessary commands in a single file. Now, to authorize, simply run this script, saving time and minimizing the risk of errors. Using Bash scripts to automate routine tasks makes server management more efficient and convenient. This article discusses the process of automation using Bash, as well as basic commands for working with files. You will learn how to create a file, set executable permissions for it, and run it. Mastering these basic skills will allow you to effectively utilize automation in your work.

Working with Aliases on the Command Line

Reading this material will help you become familiar with examples of useful aliases and expand your knowledge of their functionality. This knowledge will allow you to use aliases more effectively in various projects and improve their productivity.

Read on nixCraft.

An alias, also known as an alias, is a shorthand for a command or group of commands in various operating systems. Using aliases can significantly improve the efficiency of command entry, speed up the workflow, and contribute to overall productivity. Aliases are especially useful for automating frequently performed tasks, saving users time and reducing the likelihood of errors when entering commands. Setting up aliases is a simple and effective way to streamline your workflow and can significantly simplify your command line experience.

This article covers the basic principles of creating aliases, as well as how to use them, temporarily disable them, and remove them from the system. It also provides 30 examples of ready-made aliases that will help you save significant time. These aliases are especially useful for tasks related to automating terminal commands and streamlining your workflow.

  • create a new command group;
  • manage a web server;
  • update a server;
  • quickly get memory, CPU, and GPU information;
  • wake up sleeping servers;
  • control firewall output;
  • manage a home router.

Additional examples can be found in the comments to this article.

A Guide to Debugging Bash Scripts

Reading this material will help you reduce the number of errors when working with Bash scripts and improve the efficiency of their debugging. You will learn useful tips and techniques that will improve the quality of your code and simplify the process of identifying and fixing errors. Optimizing your Bash scripting is important for improving the productivity and reliability of your projects, so it's worth paying attention to.

Read more on the Network World website.

Complex scripts often contain errors, but there are effective algorithms that can help eliminate them. Proper debugging and testing are key aspects of development. Using techniques such as logging, development testing, and version control systems can significantly reduce the number of bugs. Furthermore, using algorithms such as search and replace, as well as static code analysis methods, allows you to identify potential problems early. Code optimization and the use of modern tools also contribute to the stability and reliability of scripts. Thus, by following best practices and using proven algorithms, developers can significantly improve the quality of their projects.

  • When creating loops, start with a syntactic "skeleton" - this will ensure you remember to terminate them correctly.
  • Make sure your script checks the number of arguments, their types, and the presence of necessary files. This will help significantly reduce the risk of runtime errors.

The article presents best practices, supplemented by relevant examples that help clearly understand the material. Debugging techniques using the -h argument, which allows you to print each line to the screen when executing a script, are also discussed. This greatly simplifies the process of finding and fixing errors, making the code more understandable and efficient.

Which is better, Bash or Zsh?

Reading this material will help you understand the differences between the two popular command shells. This knowledge will help you make an informed choice and determine which shell best suits your needs and preferences.

You can read on the hands-on.cloud platform.

Bash and Zsh are the most popular command shells in the Linux world. Bash was developed in 1989 and quickly became the standard shell for most Linux distributions due to its simplicity and functionality. Zsh, which appeared in 1990 as an extension of the Bourne shell, has also gained wide recognition and is now built into many Linux distributions by default. Both shells offer powerful tools for task automation and system management, but have their own unique features and capabilities, making them the choice for different users.

The author of the article conducted a comparative analysis of the user experience (UX) of the two shells, presenting a visual table highlighting the key differences between them. This will help readers better understand the features of each shell and choose the one most suitable for their needs.

Here are some of them:

  • Bash scripting is much more common than Zsh scripting.
  • Zsh has more advanced features than Bash.
  • Bash has a simpler structure of configuration files.
  • Zsh is more flexible in terms of customization.

Zsh is a more functional and customizable shell, while Bash remains the most popular and widely used. This is important to keep in mind when writing scripts, as it is recommended to create them with Bash compatibility in mind. The author uses both shells: Zsh for personal tasks and Bash for server administration.

Adding Arguments and Options to Scripts

Reading this material will help you master effective methods of working with data in scripts. You will learn how to optimize information processing and improve the performance of your programs. Understanding the principles of working with data will allow you to create more reliable and scalable solutions.

You can read the information on the official Red Hat website.

Automation is one of the key tasks of a system administrator. During automation, it is often necessary to pass data, such as a username or file name. For this purpose, positional parameters, also known as arguments or options, can be used to optimize and simplify the execution of various scripts and commands. Proper use of these tools significantly increases the efficiency of working with systems and saves time.

Positional parameters function differently depending on their location in the command. To optimize their use, it is important to create a structure in which the order of parameters is not critical, but you can still effectively manage the process. This can be achieved through the use of special command line options, which allow you to customize interaction with parameters, making it more flexible and convenient.

This article provides a detailed guide to data entry using positional parameters. Methods for controlling program execution flow using various options are discussed. It also describes how to create help information for your program, which will help users more easily navigate the functionality and capabilities of your application.

A Cheat Sheet for Forensics on the Linux Command Line

Reading this information will help you understand the key aspects to pay attention to in order to protect yourself from potential hacking attempts. Knowing the main signs and methods used by attackers will allow you to improve your level of security on the internet. This is especially important in the context of growing cybersecurity threats. Pay attention to tips and recommendations that will help you minimize risks and protect your personal data.

Read on Sandfly Security.

This article features a presentation by Craig Rowland, founder of Sandfly Security, at the PurpleCON conference. In this article, you'll find a link to a recording of the talk, a presentation, and a cheat sheet containing five key entities that are important when conducting forensic analysis on the Linux command line. Let's look at what to pay attention to first.

  • Processes - suspicious processes and activity.
  • Directories - suspicious directories that may contain malicious data.
  • Files - fake or malicious files.
  • Users - suspicious user activity.
  • Logs - checking the logs may reveal that someone was trying to cover their tracks.

You can delve deeper into the topics covered in our digest articles and master your command line skills in the "Working with the Bash Command Line" course from Skillbox. This course will help you become an expert in using Bash, which will greatly simplify the performance of various tasks and increase your productivity.

Linux OS Administration

You will get acquainted with the Linux OS and its advantages, learn how to work with the command line and manage network connections. You can become a Linux administrator, configure and maintain servers in the company.

Find out more