Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Shell Scripting
  • Kali Linux
  • Ubuntu
  • Red Hat
  • CentOS
  • Docker in Linux
  • Kubernetes in Linux
  • Linux interview question
  • Python
  • R
  • Java
  • C
  • C++
  • JavaScript
  • DSA
Open In App
Next Article:
uname command in Linux with Examples
Next article icon

tracepath command in Linux with Examples

Last Updated : 05 Sep, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

The ‘tracepath’ command in Linux is a network diagnostic tool used to trace the path packets take to reach a destination, discovering the Maximum Transmission Unit (MTU) along the way. It operates similarly to the traceroute command but does not require superuser privileges and offers a simpler set of options, making it user-friendly and accessible for basic network troubleshooting. Additionally, ‘tracepath6’ serves as an alternative to traceroute6 for IPv6 addresses, leveraging Linux error queues effectively.

What Does the ‘tracepath’ Command Do?

The primary purpose of the ‘tracepath’ command is to trace the network path to a specified destination and identify the MTU of each hop along the path. This information is valuable for diagnosing network issues, such as packet fragmentation or routing problems. Unlike traceroute, ‘tracepath’ uses a range of UDP ports instead of requiring elevated privileges, making it a safer and more accessible option for regular users.

Syntax:

tracepath [-n] [-b] [-l pktlen] [-m max_hops] [-p port] destination 

‘tracepath’ command Example in Linux

tracepath command without any option: It will print the general syntax of the command along with the various options that can be used with the tracepath command as well as gives a brief description about each option.

  • In the following example using tracepath command we are trying to trace path to destination for google.com.
    tracepath www.google.com

Options Available for the tracepath Command

1. tracepath -n

This option prints primarily IP addresses numerically.

Example:

tracepath -n www.google.com

2. tracepath -b

This option print both of host names and IP addresses.

Example:

tracepath -b www.google.com

Lightbox

3. tracepath -l

This option sets the initial packet length to ‘pktlen’ instead of ‘65535’ for ‘tracepath’ or ‘128000’ for ‘tracepath6’.

Example:

tracepath -l 29 www.google.com

Lightbox

4. tracepath -m

This option will set maximum hops (or maximum TTLs) to ‘max_hops’ instead of 30.

Example:

tracepath -m 31 www.google.com

Lightbox

5. tracepath -p

This option will set the initial destination port to use.

Example:

tracepath -p 8080 www.google.com

Lightbox

Conclusion

The ‘tracepath’ command is a simple yet effective tool for network diagnostics in Linux. By tracing the route that packets take to a destination and discovering MTU sizes along the path, it provides valuable insights into network performance and potential issues. Its ease of use, combined with the lack of need for superuser privileges, makes it an ideal choice for both novice and experienced users looking to troubleshoot network connectivity problems.


Next Article
uname command in Linux with Examples

R

rahulkumarmandal
Improve
Article Tags :
  • Linux-Unix
  • linux-command

Similar Reads

  • How to Manage System Services in Linux | systemctl Command
    Linux operating systems are known for their robustness and versatility, and managing system services is a crucial aspect of maintaining a well-functioning system. With the advent of systemd, a system and service manager for Linux operating systems, the systemctl command has become an essential tool
    8 min read
  • tac command in Linux with Examples
    tac command in Linux is used to concatenate and print files in reverse. This command will write each FILE to standard output, the last line first. When no file is specified then this command will read the standard input. Here, we will look deeper into the tac command, exploring its syntax, various o
    3 min read
  • Tail command in Linux with examples
    It is the complementary of head command. The tail command, as the name implies, prints the last N number of data of the given input. By default, it prints the last 10 lines of the specified files. If more than one file name is provided then data from each file is preceded by its file name. Syntax of
    7 min read
  • How to Compress Files in Linux | Tar Command
    File compression is a fundamental task in managing and transferring data efficiently on a Linux system. The Tar command, short for Tape Archive, is a powerful tool that allows users to create compressed and archived files. In this comprehensive guide, we will explore the various options and examples
    11 min read
  • tee command in Linux with examples
    tee command reads the standard input and writes it to both the standard output and one or more files. The command is named after the T-splitter used in plumbing. It basically breaks the output of a program so that it can be both displayed and saved in a file. It does both the tasks simultaneously, c
    2 min read
  • time command in Linux with examples
    'time' command in Linux is used to execute a command and prints a summary of real-time, user CPU time and system CPU time spent by executing a command when it terminates. 'real' time is the time elapsed wall clock time taken by a command to get executed, while 'user' and 'sys' time are the number of
    6 min read
  • How to Monitor System Activity in Linux | top Command
    top command is used to show the Linux processes. It provides a dynamic real-time view of the running system. Usually, this command shows the summary information of the system and the list of processes or threads which are currently managed by the Linux Kernel. As soon as you will run this command it
    10 min read
  • How to Create an Empty File in Linux | Touch Command
    The touch command is a standard command used in the UNIX/Linux operating system which is used to create, change and modify the timestamps of a file. Basically, there are two different commands to create a file in the Linux system which are as follows: touch command: It is used to create a file witho
    8 min read
  • tr command in Unix/Linux with examples
    The tr command is a UNIX command-line utility for translating or deleting characters. It supports a range of transformations including uppercase to lowercase, squeezing repeating characters, deleting specific characters, and basic find and replace. It can be used with UNIX pipes to support more comp
    4 min read
  • tracepath command in Linux with Examples
    The 'tracepath' command in Linux is a network diagnostic tool used to trace the path packets take to reach a destination, discovering the Maximum Transmission Unit (MTU) along the way. It operates similarly to the traceroute command but does not require superuser privileges and offers a simpler set
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences