Linux command chaining

POSIX-compliant Linux shells like bash, zsh and sh provide a feature called “command chaining”, which lets you connect multiple commands using specific operators to control their execution based on success, failure or sequence 😎👆#software

Find high-res pdf books with all my #linux infographics at https://study-notes.org

2025/3/30 Edited to

... Read moreLinux command chaining is a powerful technique that allows users to combine multiple commands seamlessly. By leveraging different operators, you can control the flow of command execution based on the success or failure of previous commands. This approach not only saves time but also improves productivity in managing tasks. One common use case is sequential chaining, which enables commands to run one after another, irrespective of the previous command's outcome. For instance, using 'mkdir testdir; cd testdir; touch file.txt' creates a directory and then navigates into it, showing how straightforward command chaining can be. Conditional execution is another vital aspect. The '&' operator allows you to run a following command only if the preceding command succeeds, while the '||' operator executes a command if the prior command fails. For example, 'pgrep nginx || echo "nginx is not running"' effectively checks the status of a service and alerts the user accordingly. Furthermore, using pipelines such as 'ps aux | grep nginx | awk '{print $2}'', you can pass outputs directly from one command to another, facilitating complex data processing. Additionally, redirection operators ('>' for overwrite and '>>' for append) let you manage command outputs efficiently, allowing tasks like 'dmesg | grep error >> system_errors.log' to capture and log system errors automatically. With these powerful command chaining techniques, Linux users can streamline their workflows significantly, making it an essential skill to master for anyone working in a Unix-like environment.

Related posts

Linux command chaining
POSIX-compliant Linux shells (bash, zsh, sh) support command chaining — a simple way to link multiple commands and control whether the next one runs based on success, failure, or just order of execution 😎👆 Find a high-res pdf book with all my Linux related infographics from https://study-notes.o
Dan Nanni

Dan Nanni

6 likes

A young woman with long dark hair, wearing a pink satin shirt, smiles at the camera while sitting at a table. Overlay text reads: 'Tools and sites I use as a cybersecurity student to progress my skills and keep me interested in studying'.
A screenshot of 'The Hacker News' website, displaying various cybersecurity news articles from January 2025, including topics like vulnerabilities, malware, cyber espionage, and AI jailbreak methods. An ad for Zscaler and a banner for CIS Hardened Images are also visible.
A screenshot of the O'Reilly learning platform, showing various books and expert playlists related to AI, engineering, and data. Overlay text highlights the subscription cost ($50/month or $499/year) and its value for accessing books and live events.
Tools and sites I use as a cybersecurity student 🌸
#cybersecuritystudent #cybersecurity #techgirlie
LexiStudies

LexiStudies

104 likes

Powerful Websites
#freewebsite #website #fromsoftware #fyplemon8 #fyp
Tha Smoke Websites

Tha Smoke Websites

620 likes

An infographic titled 'Linux curl Command Examples' provides a comprehensive list of curl commands. It covers HTTP GET operations with options like user-agent and custom headers, HTTP POST/PUT operations for data and file uploads, and various file download operations including resuming and rate-limiting. Created by Dan Nanni.
Linux curl command examples
The curl command is a flexible tool that lets you send or receive data from servers using protocols like HTTP, HTTPS, FTP, and others, all from the command line Here are useful curl command examples 😎👆 #devops #opensource #software #TechTips Find high-res pdf books with all my #lin
Dan Nanni

Dan Nanni

7 likes

A Linux I/O Redirection cheat sheet created by Dan Nanni, detailing various shell commands for redirecting, appending, and combining standard input, output, and error streams. It includes examples like `cmd < file`, `cmd > file`, `cmd 2> file`, `cmd > file 2>&1`, and `cmd <<< "string"` with their corresponding descriptions.
Linux I/O redirection cheat sheet
Here is a concise reference of Linux shell operators for redirecting, appending, and combining standard input, output, and error streams 😎👇 Find high-res pdf ebooks with all my Linux related infographics at https://study-notes.org #linux #sysadmin #infosec #devops #softwareengine
Dan Nanni

Dan Nanni

6 likes

A woman stands on a palm-lined street with text overlay 'FREE COURSES you can take online to boost your resume' and logos for Udemy and Coursera, promoting free online learning platforms.
A screenshot of Google search results for 'free udemy courses' and a list of various free Udemy courses like 'Canva Essentials' and 'Git & GitHub Crash Course', demonstrating options for professional development.
A screenshot of Coursera's 'Popular Free Courses' section, showcasing university-partnered courses from institutions like Yale and Princeton, highlighting options for resume-boosting education.
FREE courses to put on your resume 💻
What do I love more than online learning? FREE online learning! Popular online course providers like Udemy and Coursera offer libraries of free courses anyone can take! And they span a huge variety of topics from coding to public speaking to art history. In today’s job market, having in deman
hannah 💟

hannah 💟

510 likes

Crown CarPlay effect
Crown CarPlay effect #appel car play #carplay #toyota #linux #androidauto
QUN MO

QUN MO

1 like

I’m Linuxvr!
#gettoknowme #gorillatag #fyp #newcontentcreator #linux
🧑‍💻🐧Linuxvr_Offical🐧🧑‍💻

🧑‍💻🐧Linuxvr_Offical🐧🧑‍💻

1 like

A Linux watch command cheatsheet created by Dan Nanni, listing various commands to monitor system metrics in real-time. Examples include tracking CPU/memory usage, disk space, log file growth, network activity, and system errors, with refresh intervals specified.
Linux watch command cheatsheet
Ever wish you could just run a command and keep seeing it update automatically as things change? That is exactly what the watch command does on Linux Here are useful examples of the watch command 😎👆 Find high-res pdf ebooks with all my Linux related infographics at https://study-notes.org
Dan Nanni

Dan Nanni

4 likes

🛑 Stop paying for Photoshop or struggling with Canva limitations… 🎯 GIMP is the free design software I teach all my students to use—and it works like a charm for custom products. 👩🏽‍💻 In this quick tutorial, I’ll show you exactly how to download it, set it up, and pin it to your desktop so you’r
www.DesigningMadeEasy.com

www.DesigningMadeEasy.com

14 likes

Beginner Streamer Tips
realized this vid is pretty fast so comment if you need me to go more in depth or if you need help!!! <3 #obs #streamingtips #beginnerstreamer
melo.byx

melo.byx

10 likes

defiantfreedom

defiantfreedom

4 likes

Fujitsu Alphard upgraded with CarPlay, unbeatable
Fujitsu Alphard upgraded with CarPlay, unbeatable sound quality #carplay #toyota #lexyus #linux #carplayinterface Ourisman Chantilly Toyota
CAR TEC

CAR TEC

2 likes

An image featuring the text "Nothing kills you faster than your own mind. Don't stress over things that are out of your control. Share this if you agree" highlighted in yellow on a textured light gray background. Below the text is an illustration of blue mountains with snow caps rising above white clouds, with the Lemon8 logo and @rickthefactor handle.
Nothing Kills Faster Than Your Own Mind 🔑ℹ️👇
The mind is a wild flame — it can warm your soul or burn you down. Worry is the thief that steals peace, chaining you to storms you cannot command. Release what you cannot hold; some battles are fought best by letting go. Control is a shadow that slips through fingers— True strength is found
RoadToRiches

RoadToRiches

30 likes

#fyp #Lemon8 #tiktok #tech #codember
codember

codember

3 likes

defiantfreedom

defiantfreedom

77 likes

A computer monitor displays a Linux Mint desktop with its distinctive logo. The screen shows numerous folders labeled with names of classic gaming systems such as Sega Genesis, Atari 2600, Gameboy, Super Nintendo, MAME Roms, Neo Geo CD, Nintendo 64, Nintendo DS, PS2, and PS3.
Linux Mint User
I don't have windows installed on my computer at all. I use Linux Mint and I absolutely love it! #linux #computer #Lemon8Diary
Robert Ramos

Robert Ramos

10 likes

An infographic titled 'Understanding Linux Signals' illustrates signal sources like kernel-detected faults, system calls, and kernel subsystems. It shows how processes handle signals through default actions, custom handlers, or ignoring them. A table details common signals, their numbers, default actions, and triggering conditions.
Understanding Linux signals
“Signals” provide a lightweight mechanism for the Linux kernel and other processes to asynchronously notify a running process about events such as faults, user interrupts, or system conditions 😎👆 Find high-res pdf ebooks with all my Linux related infographics at https://study-notes.org #linu
Dan Nanni

Dan Nanni

8 likes

Linux firewall management tools
Firewall management tools provide centralized control to define, automate, and enforce network traffic filtering rules across systems using CLI, GUI, or web interfaces. Here are a list of firewall management tools available on Linux 😎👆 Find high-res pdf ebooks with all my cybersecurity rela
Dan Nanni

Dan Nanni

1 like

Linux netcat command examples
The netcat command lets you read from and write to network connections using TCP or UDP. Its flexibility makes it a must-have for infosec professionals, who use it for tasks such as port scanning, banner grabbing, and setting up reverse shells during penetration tests. Here are useful netstat co
Dan Nanni

Dan Nanni

9 likes

Yazi: a terminal-based Linux file manager
Yazi is a blazingly fast terminal file manager written in Rust, based on non-blocking async I/O. It aims to provide an efficient, user-friendly, and customizable file management experience within Linux terminals. A strong contender for the best TUI-based file manager title 😎👆 Find high-res pdf
Dan Nanni

Dan Nanni

3 likes

Student Teaching Series: What to bring to student teaching!! Please let me know if you guys have ANY questions and I will do my best to make videos over the next couple weeks for you. I’m an open book and would LOVE to pass on anything I’ve learned. ☺️ #teachersoftiktok #middleschoolteacher
Kelly Having

Kelly Having

5 likes

Ça c'est les pieds d'un français 🇫🇷 #lemon8 #lemon8fr #tiktok #tiktokfr
pierrebg2004

pierrebg2004

4 likes

Estas tres comidas son muy normales que me digan que lo hacen mis pacientes porque no sabían que era algo malo .. estos alimentos son muy altos en su índice glucemico y tiene el poder de subir tu azúcar por lo tanto disminúyelos #nutrióloga #bajarazucar #nutricion #comida
Nutriologaziomaramarquez

Nutriologaziomaramarquez

11 likes

A Linux Cheatsheet for Engineers from @thealpha.dev, listing various commands categorized into File System Operations, File Permissions, Process Management, Networking, System Information, Package Management, Shell Scripting, User and Group Management, File Transfer, and System Services. A penguin on a skateboard is at the bottom.
Linux cheat sheet✨️
Where are my tech babes at?👩🏿‍💻 This is something I'm learning in school😍 It's been super fun typing things into the command line and actually getting a response🥹💕💕💕 One of my classmates shared this cheat sheet to make using Linux easier #imdoingsomethingright #CybersecurityAwarenessMon
Deya!

Deya!

27 likes

How to merge multiple Starlink dishes for MUCH faster internet
Cav and Nicole

Cav and Nicole

1 like

An infographic titled 'Useful TUI Linux Software' with a Tux penguin logo. It defines TUI as Text-based User Interface for terminal environments and lists various software categorized under Disk Manager, System Monitor, Web Browser, Network Manager/Monitor, Multimedia, GPT, Git, Coding, File Manager, and Messaging.
Useful TUI software on Linux
Linux TUI (Text User Interface) software offers a user-friendly way to interact with applications directly from the terminal, using text-based menus and interfaces instead of a graphical desktop environment Here are a categorized list of useful TUI software available on Linux 😎👆 #software #o
Dan Nanni

Dan Nanni

4 likes

Useful awk command examples
Awk is a powerhouse text tool — it can scan files or streams, match patterns, and run custom actions on the fly, making it perfect for quick data filtering, parsing, and one-line automation Here are useful awk command examples 😎👇 Find high-res pdf books with all my Linux infographics at https
Dan Nanni

Dan Nanni

4 likes

Useful sysdig command examples
Sysdig is one of those hidden gem tools that shows exactly what your Linux system is doing in real time — system calls, containers, network traffic, file access — everything, no guessing. Here are useful sysdig command examples 😎👆 Find high-res pdf ebooks with all my cybersecurity related inf
Dan Nanni

Dan Nanni

5 likes

This image displays a table titled 'Deprecated Linux Command Usage' by Dan Nanni. It compares various deprecated Linux commands like ifconfig, netstat, fdisk, route, and arp with their modern, up-to-date alternatives such as ip and ss, providing a description for each command's function.
Deprecated Linux command examples
Just like anything else, even widely used Linux tools can become outdated as better and more efficient options emerge. Once deprecated, these tools typically stop receiving new features or security updates, even if they’re still accessible. While it can be tough to move on from familiar habits,
Dan Nanni

Dan Nanni

8 likes

Linux commands for hardware information
Knowing your hardware is essential for effective troubleshooting, system tuning, and performance optimization. That’s why it’s important to be familiar with the OS tools that let you examine different parts of your system’s hardware Here are a list of useful Linux commands for looking up hardwar
Dan Nanni

Dan Nanni

3 likes

An infographic titled 'OpenSSH Command Examples' by Dan Nanni, listing twelve practical OpenSSH commands for secure remote logins, file transfers, and command execution, including custom port connections, key authentication, preventing timeouts, running remote commands, port forwarding, jump servers, copying public keys, custom config files, SOCKS proxies, and connection multiplexing.
OpenSSH command examples
OpenSSH is a versatile suite of client and server tools that use the SSH protocol to provide encrypted and authenticated communication over networks. This toolset is heavily used for secure remote logins, file transfers, and command execution in various cloud and on-premises environments Here ar
Dan Nanni

Dan Nanni

6 likes

A black background image titled "Linux scp Command Examples" lists various scp commands with their functions, including copying files/directories, using custom SSH ports, compression, private keys, rate-limiting, and jump servers. It also features a small circular image with "Created by Dan Nanni study-notes.org".
Scp command examples
The scp command lets you securely copy files between hosts over an SSH connection. Some of you might think scp is deprecated but in fact what’s deprecated is the scp protocol, not the command itself. The command now uses a more secure sftp protocol by default Here are some of useful scp com
Dan Nanni

Dan Nanni

5 likes

Plugging in a suspicious USB someone sent me into my laptop #linux #kail #usb #laptop #tech
Riana

Riana

437 likes

defiantfreedom

defiantfreedom

2 likes

Programming an Arduino as a serial controller
I programmed an Arduino Mega to be a serial controller for Xlights to control WS2811 addressable LEDs I am working on the last two videos for the DIY Christmas Light Controller mini-series, and it's finally time to start controlling LEDs. My original plan was to use an ESP32 based Light c
EETEngineer

EETEngineer

12 likes

Fed Meyer Gas Pump
This one was posted 11 years ago from a Fred Meyer gas station showing a Linux boot screen at the pump. #linux #fredmeyer #computer #computerscience
Professor Linux

Professor Linux

1 like

Online learning resources for software developers
Want to pick up a new programming language or master a DevOps tool? No problem! Plenty of great learning resources are available online for free! 😎👆 #devops #coding #programming #softwaredeveloper
Dan Nanni

Dan Nanni

82 likes

This image displays "Useful Linux Cron Examples," a comprehensive list of cron job schedules. It shows various cron expressions with corresponding commands and descriptions for tasks like running every minute, hourly, daily, weekly, monthly, yearly, at system startup, and more, created by Dan Nanni.
Useful Linux cron examples
Linux cron schedules recurring tasks at defined times using flexible expressions for minutes, hours, days, and months Here are useful cron job examples 😎👇 #software #softwaredeveloper #TechTips #technicalinterview Find a high-res pdf book with all my #linux related infographics fro
Dan Nanni

Dan Nanni

6 likes

An infographic details the Linux /etc/shadow file, showing its structure with fields like username, password hash, last change, min/max days, warn, inactive, expire, and reserved. It defines each column and provides examples for user 'dan' and 'sshd' accounts, explaining their password security settings.
Linux /etc/shadow file overview
On Linux, /etc/passwd stores basic user account information and was historically used for password storage. But, for security reasons, hashed passwords have been moved to /etc/shadow, which is only accessible by root Here is how to interpret the /etc/shadow file 😎👆 Find high-res pdf books wit
Dan Nanni

Dan Nanni

4 likes

linux distro linux ricing :)
Linux Ricing #linux #computer
☬hyprland✇

☬hyprland✇

6 likes

An infographic titled 'Linux Commands for Hardware Info' by Dan Nanni, listing various Linux commands and their functions for checking hardware components like CPU, memory, storage, network, display, and peripherals, along with system information.
Linux commands for hardware information
Here are useful Linux commands for looking up hardware information such as hardware vendor or model info 😎👆 #sysadmin #devops #opensource #TechTips Find high-res pdf books with all my #Linux related infographics at https://study-notes.org
Dan Nanni

Dan Nanni

2 likes

Lemongrass66

Lemongrass66

9 likes

✨Anthropic just announced it’s donating MCP to the Linux Foundation, under a brand-new Agentic AI Foundation called AAIF, co-founded by Anthropic, OpenAI, and Block. #aiengineer #technews #agenticai
lindavivah

lindavivah

1 like

defiantfreedom

defiantfreedom

7 likes

An infographic titled 'Linux /proc Filesystem' by Dan Nanni, featuring the Linux penguin mascot. It lists numerous /proc entries like /proc/cpuinfo, /proc/meminfo, and /proc/[PID]/status, detailing the system information each provides, such as CPU, memory, and process statistics.
Linux /proc filesystem
The Linux /proc filesystem is a virtual interface that exposes live system information and kernel parameters, enabling users to monitor hardware and processes and adjust kernel settings at runtime Here are a list of useful /proc entries 😎👆 #software #softwaredeveloper #computer Find
Dan Nanni

Dan Nanni

5 likes

An infographic titled 'Linux netcat Command Examples' lists various `nc` commands for network tasks like port scanning, file transfer, creating shells, and streaming. It includes commands for TCP/UDP, IPv6, and persistent listeners, credited to Dan Nanni.
Useful netcat command examples
Netcat is the Swiss army knife of networking. It lets you read and write data over TCP or UDP, and infosec folks use it all the time for things like quick port scans, grabbing service banners, or setting up reverse shells. Here are useful netstat command examples 😎👆 Find high-res pdf ebooks w
Dan Nanni

Dan Nanni

3 likes

Old bank notes
I collect also bank notes
defiantfreedom

defiantfreedom

7 likes

An infographic titled 'Linux Security Hardening' by Dan Nanni, listing essential commands for system upgrades, user and SSH security, firewall setup, file permission checks, service management, port monitoring, USB device control, legacy service checks, and security auditing tools.
Linux system hardening commands
Securing a system against threats requires reducing vulnerabilities, tightening access, and disabling unnecessary services. Here are useful Linux commands for that 😎👆 #linux #softwaredeveloper #TechTips #upskill Find high-res pdf books with all my #cybersecurity related infographics
Dan Nanni

Dan Nanni

10 likes

An infographic titled 'Privacy-Focused Linux Distros' lists nine operating systems: Debian, Fedora, Kicksecure, Linux Kodachi, MOFO Linux, Parrot OS, Qubes OS, Tails OS, and Whonix, each with a brief description of its privacy and security features. It also credits Dan Nanni.
Privacy-focused Linux distributions
Privacy focused Linux distros minimize data collection and metadata leakage by default while prioritizing anonymity, isolation, and user control over networking, software behavior, and system telemetry. Here are some of the most popular Linux distros for privacy-conscious users 😎👆 Find high-r
Dan Nanni

Dan Nanni

9 likes

Linux awk command examples
The awk command is a versatile tool for processing text, enabling users to scan files or streams, match patterns, and perform custom actions on the matched data Here are useful examples of the awk command 😎👇 #sysadmin #opensource #devops Find high-res pdf books with all my #Linux
Dan Nanni

Dan Nanni

6 likes

An infographic titled 'Linux /proc Filesystem' by Dan Nanni, listing various /proc entries and their functions. It details how to access real-time system information, including CPU, memory, network, disk I/O, kernel, and process-specific data, presented with folder icons on a dark background.
Linux /proc filesystem
The /proc filesystem in Linux is a virtual gateway to real-time system info, from hardware stats to kernel parameters, letting you monitor and tweak your system on the fly Here are some of the most useful /proc entries 😎👆 #TechTips #software #softwaredeveloper Find high-res pdf books
Dan Nanni

Dan Nanni

5 likes

See more