Linux command chaining

Linux shells like bash and zsh make it easy to combine commands using chaining, command substitution, and process substitution, letting you run tasks in sequence, reuse command output, or connect commands more flexibly 😎👆

Find a high-res pdf ebook with all my Linux related infographics from https://study-notes.org

#linux #sysadmin #kalilinux #devops #software

4 days agoEdited to

... Read moreWhen working in Linux shells such as bash or zsh, mastering command chaining is a real game changer for productivity. From my own experience managing Linux servers, using sequential chaining (;) allows me to run multiple commands back-to-back without worrying if one fails—perfect for setting up environments quickly. However, to create more robust scripts or commands, I often rely on conditional execution: the && operator ensures the next command runs only if the previous succeeds, which helps prevent errors from cascading. For instance, I use "mkdir logs && cd logs && touch error.log" to prepare log directories safely. Alternatively, the || operator is handy when you want to trigger fallback actions on failure, such as notifying when a service isn't running. Pipelines (|) are equally vital—they let you pass output from one command as input to another, enabling powerful data filtering and extraction. A common example I use is "ps aux | grep nginx | awk '{print $2}'" to find process IDs easily. Command substitution using $() comes in handy when a command’s output needs to be used as an argument in another, such as killing nginx processes with "kill $(pgrep nginx)". Meanwhile, process substitution <() is invaluable for comparing sorted contents of files using diff, without creating intermediate files. Incorporating these techniques into your Linux toolkit not only speeds up workflows but also adds flexibility and control. These chaining methods have been essential for automating system administration tasks and DevOps deployments in my day-to-day work. If you are seeking to deepen your Linux skillset, practicing these command chaining forms will significantly enhance your command line efficiency and effectiveness.

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

An infographic titled "Linux Command Chaining" explains various command chaining methods. It covers sequential chaining, conditional execution for success (&&) and failure (||), combined success/failure conditions, pipelines (|), and redirection (>, >>), each with a command example. The graphic is created by Dan Nanni from study-notes.org.
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 infogra
Dan Nanni

Dan Nanni

3 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

107 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 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

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

🧑‍💻🐧Linuxvr_Offical🐧🧑‍💻

1 like

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

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

QUN MO

1 like

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

1 like

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

Tha Smoke Websites

700 likes

#fyp #Lemon8 #tiktok #tech #codember
codember

codember

3 likes

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

10 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

7 likes

defiantfreedom

defiantfreedom

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

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

11 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

🛑 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

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 '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

Cave Dwellers Built the First Data Center
When your ancestors were running Linux before fire was invented. Stone age server farms hit different. #midjourney #cavecore #techno #ancient #cyberpunk
HalluciNEET 9000

HalluciNEET 9000

2 likes

An infographic titled 'Linux cp Command Examples' presents a comprehensive list of `cp` command variations and their uses, including copying files, directories, preserving attributes, handling symbolic links, and using `find` and `rsync` for advanced copying tasks. The content is created by Dan Nanni.
Linux cp command examples
Many of you probably learned the cp command early on in Linux, but if you haven’t explored its full set of options and are too lazy to read its man page, you might be missing out on its true power Let’s review some useful examples of the command 😎👆 #softwareengineer #softwaredeveloper #sof
Dan Nanni

Dan Nanni

8 likes

Stop paying monthly for AI tools
Pinokio lets you run video, image and voice models like Flux, Stable Diffusion and Wan locally on your computer with unlimited private usage, no internet needed.
Krofile.com

Krofile.com

0 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

6 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

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

4 likes

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

pierrebg2004

4 likes

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

☬hyprland✇

6 likes

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

Lemongrass66

Lemongrass66

9 likes

defiantfreedom

defiantfreedom

2 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

5 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

7 likes

Two tips that are hard to hear. Thank you @jlinuxcheung #bosslady #talent #talentmanager #worldcup #iceman
Yana Eloul

Yana Eloul

0 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

Windows vs. Linux: pros and cons
Thinking about switching from Windows to Linux? Here is a quick look at the pros and cons to help you decide whether Linux fits your workflow, your hardware, and your comfort level 😎👆 Find high-res pdf ebooks with all my Linux related infographics from https://study-notes.org #linux #
Dan Nanni

Dan Nanni

1 like

Duping $18,000,000 USD on the UN-DUPABLE Pay-to-Win Minecraft Server...
torque.test

torque.test

0 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

This image displays an X.com post by @openclaw announcing that their AI assistant project has surpassed React in GitHub stars. The post highlights OpenClaw's rapid development and includes a partial "Star History" graph showing openclaw/openclaw's star count exceeding facebook/react's.
OpenClaw surpassing React in GitHub stars is a notable milestone. React, like Linux, represents long-standing infrastructure, but this reflects a broader shift as AI projects play a growing role in capturing developer attention and shaping industry innovation. #openclaw
John A. J. Kwok

John A. J. Kwok

1 like

OpenShot 3.4
This release introduces an experimental timeline, interactive cropping in the video preview, and huge performance improvements across the entire app. ARTICLES: 1) https://9to5linux.com/openshot-3-4-open-source-video-editor-released-with-new-effects-and-features 2) https://www.openshot.org/bl
Benjamin Tuckett

Benjamin Tuckett

0 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

defiantfreedom

defiantfreedom

1 like

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

An infographic titled 'Linux FUSE-based Filesystems' categorizes various filesystems. Categories include Remote and Cloud, Archive and Image, Encrypted and Secure, Legacy and Compatibility, and Special-Purpose and Experimental filesystems, with examples for each. The infographic was created by Dan Nanni from study-notes.org.
Useful Linux FUSE filesystems
A FUSE filesystem is a user-space filesystem built on top of the Filesystem in Userspace (FUSE) kernel module, allowing developers to implement custom storage logic without writing kernel code Here are a categorized list of Linux FUSE filesystems 😎👆 #softwareengineer #computerscience #TechT
Dan Nanni

Dan Nanni

4 likes

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

An infographic titled "Linux strace Command Examples" defines strace as a Linux diagnostic tool. It lists various strace commands for tracing system calls, logging output, attaching to processes, filtering by syscalls, monitoring child processes, displaying timestamps, and generating syscall summaries. It is created by Dan Nanni.
Linux strace command examples
strace is a Linux diagnostic tool that traces system calls and signals made by a process to help debug and analyze its interaction with the kernel Here are useful strace command examples 😎👇 #cybersecurity #infosec #software #technology Find a high-res pdf book with all my #linux re
Dan Nanni

Dan Nanni

4 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

This image displays a comprehensive list of useful Wireshark filter examples. It includes filters for IP addresses, ports, protocols like TCP, UDP, HTTP, DNS, TLS, DHCP, and packet properties such as length and content. The infographic was created by Dan Nanni from study-notes.org.
Useful Wireshark filter examples
Wireshark filters cut through the noise so you can focus on the traffic that matters: protocols, IPs, ports, or even packet contents. For blue teams, they help track suspicious activity and investigate forensic evidence. For red teams, they help map behavior, spot weak points, and test defenses
Dan Nanni

Dan Nanni

2 likes

An infographic explaining Linux special file permissions: SUID, SGID, and the Sticky bit. It illustrates their positions in permission strings (rwsrwsrwt), defines their functions, and provides examples like /bin/passwd for SUID, /usr/bin/crontab for SGID, and /tmp for the Sticky bit. Created by Dan Nanni.
Special file permissions on Linux
Linux uses special permissions like SUID, SGID, and the Sticky Bit for advanced access control. SUID and SGID change how execution rights are applied, while the Sticky Bit controls who can delete files in shared directories Learn about these special permissions in more details 😎👆 #technology
Dan Nanni

Dan Nanni

5 likes

defiantfreedom

defiantfreedom

7 likes

See more