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:
How to Check Network Connectivity in Linux | ping Command
Next article icon

ifconfig Command

Last Updated : 02 Jan, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Knowing your IP address is fundamental for network administration, troubleshooting, and various Linux system tasks. In this article, we will explore several methods to find your IP address in a Linux environment. Whether you are a seasoned Linux user or just getting started, understanding these methods will empower you to navigate and manage your network effectively.

Why is this important?

  • Network Configuration: ifconfig allows users to configure network interfaces, including setting IP addresses, netmasks, and broadcast addresses.
  • Network Troubleshooting: It provides detailed information about network interfaces, which is essential for diagnosing connectivity issues, monitoring network traffic, and checking interface statuses.
  • Interface Management: Users can enable or disable network interfaces, which is crucial for managing network connections and controlling which interfaces are active.
  • MAC Address Modification: ifconfig enables users to change the MAC address of a network interface, which can be useful for security purposes or bypassing network restrictions.
  • Temporary Network Changes: It allows for temporary network configuration changes without editing configuration files, useful for testing and troubleshooting.

How to Find Your IP Address in Linux Using `ifconfig Command

ifconfig (interface configuration) command is used to configure the kernel-resident network interfaces. It is used at the boot time to set up the interfaces as necessary. After that, it is usually used when needed during debugging or when you need system tuning.

Also, this command is used to assign the IP address and netmask to an interface or to enable or disable a given interface.

Syntax of `ifconfig`Command in Linux

ifconfig [interface] [options]

Where:

  • [interface] is the network interface you want to configure or display information for (e.g., eth0, wlan0).
  • [options] are various command-line options that can be used to modify the behavior of ifconfig.

Newer versions of some Linux distributions don’t have ifconfig command pre-installed. So, in case, there is an error “ifconfig: command not found”, Then execute the following command to install ifconfig.

Installing net-tools in Linux

For Debian, Ubuntu, and related Linux distributions.

sudo apt-get install net-tools

For CentOS or RPM(RedHat Package Manager) based Linux

yum install net-tools

or

dnf install net-tools

This will install `ifconfig` along with some other networking commands like arp, route, ipmaddr.

Finding Your Ip Address in Linux Using `ifconfig` Command

To view information about all network interfaces on your Linux system, simply execute the following command:

ifconfig
Finding IP Address in Linux Using `ifconfig`

Finding IP Address in Linux Using `ifconfig`

This command will provide a comprehensive list of all network interfaces along with their respective IP addresses, MAC addresses, and other relevant details.

Options available in `ifconfig` Command in Linux

Here are the most commonly used option in ifconfig command in linux

Option

Description

Syntax

-a

Display all interfaces, including those that are down

ifconfig -a

-s

Display a short list, instead of details

ifconfig -s

-v

Run the command in verbose mode

ifconfig -v

up

Activate the driver for the given interface

ifconfig interface up

down

Deactivate the driver for the given interface

ifconfig interface down

add addr/prefixlen

Add an IPv6 address to an interface

ifconfig interface add addr/prefixlen

del addr/prefixlen

Remove an IPv6 address from an interface

ifconfig interface del addr/prefixlen

[-]arp

Enable/disable the use of ARP protocol on an interface

ifconfig interface [-]arp

[-]promisc

Enable/disable promiscuous mode on an interface

ifconfig interface [-]promisc

[-]allmulti

Enable/disable all-multicast mode for an interface

ifconfig interface [-]allmulti

mtu N

Set the Maximum Transfer Unit (MTU)

ifconfig interface mtusize size

–help

Display help related to the ifconfig command

ifconfig –help

What is Public and Private IP in Linux

In the realm of networking, both in Linux and other operating systems, IP addresses are categorized as either public or private. These designations are crucial for facilitating communication between devices on a network, whether it’s the global internet or a local intranet. Let’s delve into the distinctions between public and private IP addresses in Linux.

1) How to Find Your Public IP Addresses in Linux

A public IP address is a globally unique identifier assigned to a device on the internet. It serves as the address by which other devices on the internet can find and communicate with it. Public IP addresses are assigned by the Internet Assigned Numbers Authority (IANA) to Internet Service Providers (ISPs) and other organizations that control access to the global internet.

In Linux, you can determine the public IP address of a system by using external services or commands like curl or wget to query a web service. For example:

curl ifconfig.me

This command retrieves your public IP address from a web service.

Public IP addresses are essential for servers, websites, and other devices that need to be directly accessible from the internet. They are globally routable, meaning they can be reached from any location on the internet.

Different Ways to Find Your Public IP Address in Linux

1) Using `wget` with `ifconfig.me` to Find Your IP Address in Linux

Similar to curl, this uses the ifconfig.me service to fetch your public IP address.

wget -qO- ifconfig.me
Using `wget` with `ifconfig.me` to Find Your IP Address in Linux

Using `wget` with `ifconfig.me` to Find Your IP Address in Linux

2) Using `dig` with `resolver1.opendns.com` to Find Your IP Address in Linux

This command uses the OpenDNS resolver to query your public IP address.

dig +short myip.opendns.com @resolver1.opendns.com
Using `dig` with `resolver1.opendns.com` to Find Your IP Address in Linux

Using `dig` with `resolver1.opendns.com` to Find Your IP Address in Linux

3) Using `curl` with `icanhazip.com`to Find Your IP Address in Linux

This command queries the icanhazip.com service to obtain your public IP address.

curl icanhazip.com
 Using `curl` with `icanhazip.com`to Find Your IP Address in Linux

Using `curl` with `icanhazip.com`to Find Your IP Address in Linux

4) Using `wget` with `icanhazip.com` to Find Your IP Address in Linux

Similar to the curl command, this uses the icanhazip.com service to fetch your public IP address.

wget -qO- icanhazip.com
 Using `wget` with `icanhazip.com` to Find Your IP Address in Linux

Using `wget` with `icanhazip.com` to Find Your IP Address in Linux

5) Using host with dns.google to Find Your IP Address in Linux

This command utilizes the DNS service provided by Google to resolve your public IP address.

host myip.opendns.com resolver1.opendns.com
Using host with dns.google to Find Your IP Address in Linux

Using host with dns.google to Find Your IP Address in Linux

2) How to Find Your Private IP Addresses in Linux:

Contrastingly, private IP addresses are used within a private network and are not directly accessible from the internet. These addresses are defined in reserved address ranges specified by the Internet Engineering Task Force (IETF) in RFC 1918. The commonly used private IP address ranges are:

  • 10.0.0.0 to 10.255.255.255 (10.0.0.0/8)
  • 172.16.0.0 to 172.31.255.255 (172.16.0.0/12)
  • 192.168.0.0 to 192.168.255.255 (192.168.0.0/16)

These addresses are intended for use in local networks, such as home or corporate intranets. Devices within the same private network can communicate with each other using these private IP addresses, but they rely on a mechanism called Network Address Translation (NAT) to access the internet through a shared public IP address.

In Linux, you can view the private IP addresses of your system using the ifconfig or ip addr commands. For example:

ifconfig

or

ip addr

Different Ways to Find Your Private IP Address in Linux

1) Using `hostname` to Find Your IP Address in Linux

The -I option with the hostname command can be used to display the private IP address of your machine.

hostname -I
Using hostname to Find Your IP Address in Linux

Using hostname to Find Your IP Address in Linux

2) Using `nmcli` (NetworkManager command-line tool) to Find Your IP Address in Linux

If you’re using NetworkManager, this command filters out IPv4 addresses associated with your network interfaces.

nmcli dev show | grep IP4.ADDRESS
Using nmcli to Find Your IP Address in Linux

Using nmcli to Find Your IP Address in Linux

3) Using `awk` with `ifconfig` to Find Your IP Address in Linux

This command uses the awk tool to filter and print only the private IP addresses from the ifconfig output.

ifconfig | awk '/inet / {print $2}'
Using `awk` with `ifconfig` to Find Your IP Address in Linux

Using `awk` with `ifconfig` to Find Your IP Address in Linux

4) Using `grep` with `ip` to Find Your IP Address in Linux

This command uses grep with Perl-compatible regular expressions to extract private IP addresses from the ip command output.

ip addr show | grep -oP 'inet \K[\d.]+'
Using `grep` with `ip` to Find Your IP Address in Linux

Using `grep` with `ip` to Find Your IP Address in Linux

5) Using `ss` (socket statistics) command to Find Your IP Address in Linux

This complex command lists the IP addresses to which the system is listening for incoming connections.

ss -tunapl | grep LISTEN | awk '{print $5}' | cut -d: -f1 | sort -u
Using `ss` (socket statistics) command to Find Your IP Address in Linux

Using `ss` (socket statistics) command to Find Your IP Address in Linux

Linux ifconfig Command Examples

Display Specific Network Interface

This command shows detailed information about the specified interface, eth0.

ifconfig eth0

Enable a Network Interface

This command activates the specified network interface, eth0.

ifconfig eth0 up

Disable a Network Interface

This command deactivates the specified network interface, eth0.

ifconfig eth0 down

Assign an IP Address

This command assigns the IP address 192.168.1.10 to the specified network interface, eth0.

ifconfig eth0 192.168.1.10

Set a Netmask

This command sets the netmask for the specified network interface, eth0.

ifconfig eth0 netmask 255.255.255.0

Set a Broadcast Address

This command sets the broadcast address for the specified network interface, eth0.

ifconfig eth0 broadcast 192.168.1.255

Change the MAC Address

This command changes the MAC address of the specified network interface, eth0.

ifconfig eth0 hw ether 00:1a:2b:3c:4d:5e

Add an Alias to a Network Interface

This command adds an alias with IP address 192.168.1.20 to the specified network interface, eth0.

ifconfig eth0:0 192.168.1.20

Remove an Alias from a Network Interface

This command removes the alias eth0:0 from the specified network interface.

ifconfig eth0:0 down

ifconfig Gateway

To set a gateway using the ifconfig command, you typically need to use route because ifconfig itself does not configure gateways. Here’s how to do it in a simple way:

Set IP Address and Netmask (if needed):

ifconfig eth0 192.168.1.10 netmask 255.255.255.0

Set Default Gateway:

route add default gw 192.168.1.1

Here, 192.168.1.1 is the IP address of the gateway.

Conclusion

In this article, we’ve explored how to find your IP address in Linux using the ifconfig command. We also discuss what is private and public IP address and how to display both of the IP Address .This essential skill is crucial for effective network management. Whether you’re a seasoned Linux user or a beginner, understanding these simple commands empowers you to navigate and control your network effortlessly.



Next Article
How to Check Network Connectivity in Linux | ping Command
author
rossoskull
Improve
Article Tags :
  • Linux-Unix
  • linux-command
  • Linux-networking-commands

Similar Reads

  • Linux Commands
    Linux commands are essential for controlling and managing the system through the terminal. This terminal is similar to the command prompt in Windows. It’s important to note that Linux/Unix commands are case-sensitive. These commands are used for tasks like file handling, process management, user adm
    15+ min read
  • File and Directory Manipulation

    • ls Command in Linux
      The ls command is one of the most used commands in the Linux terminal to display the files and directories or path in the terminal. So, using the ls command is a basic skill for navigating the Linux file system, handling files, and managing directories. What is the ls Command in LinuxThe ls command
      10 min read

    • How to Change the Directory in Linux | cd Command
      Navigating the Linux file system is like exploring a vast library; each directory (folder) holds its own collection of files and subdirectories, and knowing how to move between them efficiently is the first step to mastering the command line. The cd (Change Directory) command is your compass in this
      7 min read

    • How to Display Current Working Directory in Linux | pwd Command
      The 'pwd,' which stands for "print working directory." In this article, we will delve into the 'pwd' command, exploring its functionality, usage, and various examples. It prints the path of the working directory, starting from the root. pwd is shell built-in command(pwd) or an actual binary(/bin/pwd
      4 min read

    • How to Create Directory in Linux | mkdir Command
      In Linux, the 'mkdir' command is like a magic wand for creating folders super easily. 'mkdir' stands for "make directory," and it helps you organize your computer stuff by creating folders with just one command. Whether you're making one folder or a bunch of them in a row, 'mkdir' is there to help y
      7 min read

    • rm command in Linux with examples
      rm stands for remove here. rm command is used to remove objects such as files, directories, symbolic links and so on from the file system like UNIX. To be more precise, rm removes references to objects from the filesystem, where those objects might have had multiple references (for example, a file w
      5 min read

    • How to Copy Files and Directories in Linux | cp Command
      The cp (copy) command is your go-to tool in Linux for duplicating files and folders quickly. Whether you’re backing up data, organizing files, or sharing content, cp lets you copy items between locations while keeping the original intact. The cp command requires at least two filenames in its argumen
      8 min read

    • How to Move File in Linux | mv Command
      The `mv` command in Linux is like a superhero tool that can do a bunch of cool stuff with your files and folders. Think of it as a digital moving truck that helps you shift things around in your computer. Whether you want to tidy up your folders, give your files new names, or send them to different
      7 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

    • How to View the Content of File in Linux | cat Command
      The cat command in Linux is more than just a simple tool, it's a versatile companion for various file-related operations, allowing users to view, concatenate, create, copy, merge, and manipulate file contents. Let's see the details of some frequently used cat commands, understanding each example alo
      7 min read

    • grep command in Unix/Linux
      The grep command in Unix/Linux is a powerful tool used for searching and manipulating text patterns within files. Its name is derived from the ed (editor) command g/re/p (globally search for a regular expression and print matching lines), which reflects its core functionality. grep is widely used by
      7 min read

    File Operations and Compression

    • How to Find a File in Linux | Find Command
      Linux, renowned for its robust command-line interface, provides a suite of powerful tools for efficient file and directory management. Among these, the "find" command stands out as an indispensable asset, offering unparalleled versatility in searching for files based on diverse criteria. This articl
      10 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

    • Gzip Command in Linux
      The gzip command in Linux is a vital tool for compressing files and reducing their sizes. It employs the DEFLATE compression algorithm , which makes it highly effective for compressing large files or preparing data for transfer over networks. Whether you’re a Linux system administrator or a beginner
      5 min read

    • gunzip Command in Linux with Examples
      The gunzip command in Linux is a popular tool for decompressing files compressed with gzip. It simplifies file unzipping, enhances file management, and optimizes disk space in Linux environments. In this blog post, we will explore how gunzip works, providing practical examples for you to try. Whethe
      5 min read

    • ZIP command in Linux with examples
      In Linux, the zip command compresses one or more files or directories into a single.zip archive file. This saves disk space, keeps data organized, and makes it simple to share or backup files. It's among the most used compression utilities, particularly when sharing large files via email or storing
      7 min read

    • How to Install Zip and Unzip in Linux?
      Zip is a command-line compression utility for files and directories. File and folder compression allows for quicker and more reliable file and folder transfer, storage, and email. Unzip, on the other hand, is a program that allows you to decompress files and directories. zip is used to compress the
      2 min read

    • How to Make Script Executable in Linux | chmod Command
      In Unix operating systems, the chmod command is used to change the access mode of a file. The name is an abbreviation of change mode. Which states that every file and directory has a set of permissions that control the permissions like who can read, write or execute the file. In this the permissions
      7 min read

    • How to Change File Ownership in Linux | chown Command
      In the Linux operating system, file ownership is a crucial aspect of system security and user management. The `chown` command, short for "change owner," is a powerful tool that allows users to change the owner of files and directories. This command is particularly useful in scenarios where administr
      9 min read

    • chgrp command in Linux with Examples
      The `chgrp` command in Linux is used to change the group ownership of a file or directory. All files in Linux belong to an owner and a group. You can set the owner by using “chown” command, and the group by the "chgrp" command. Syntax of `chgrp` command in Linuxchgrp [OPTION]… GROUP FILE… chgrp [OPT
      3 min read

    • How to List Running Processes in Linux | ps Command
      As we all know Linux is a multitasking and multi-user system. So, it allows multiple processes to operate simultaneously without interfering with each other. Process is one of the important fundamental concepts of the Linux OS. A process is an executing instance of a program that carries out differe
      9 min read

    Network and Connectivity

    • 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 Kill a Process in Linux | Kill Command
      kill command in Linux (located in /bin/kill), is a built-in command which is used to terminate processes manually. kill command sends a signal to a process that terminates the process. If the user doesn't specify any signal that is to be sent along with the kill command, then a default TERM signal i
      6 min read

    • ifconfig Command
      Knowing your IP address is fundamental for network administration, troubleshooting, and various Linux system tasks. In this article, we will explore several methods to find your IP address in a Linux environment. Whether you are a seasoned Linux user or just getting started, understanding these meth
      10 min read

    • How to Check Network Connectivity in Linux | ping Command
      Ensuring a stable and reliable internet connection is crucial for seamless navigation and efficient communication in the world of Linux. The "ping" command is a powerful tool that allows users to check the status of their internet connection and diagnose network-related issues. In this article, we w
      7 min read

    • How to use SSH to connect to a remote server in Linux | ssh Command
      Secure Shell, commonly known as SSH, is like a super-secure way to talk to faraway computers, called servers. It's like a secret tunnel on the internet that keeps your conversations safe and private. Imagine you're sending a letter, and instead of sending it openly, you put it in a magic envelope th
      8 min read

    • How to Securely Copy Files in Linux | scp Command
      Secure file transfer is a crucial part of Linux systems administration. Whether moving sensitive files between local machines or transferring data between servers, SCP (Secure Copy Protocol) provides a fast, secure, and efficient way to copy files over a network. By utilizing SSH (Secure Shell), SCP
      11 min read

    • Wget Command in Linux/Unix
      Wget is the non-interactive network downloader which is used to download files from the server even when the user has not logged on to the system and it can work in the background without hindering the current process. GNU wget is a free utility for non-interactive download of files from the Web. It
      6 min read

    • curl Command in Linux with Examples
      curl is a command-line utility for transferring data to or from a server, employing a range of internet protocols such as HTTP, HTTPS, FTP, SCP, and SFTP. Whether you want to download a file, test a REST API, or simply verify that a website is up and running, curl is your best friend. It is accessed
      5 min read

    • How to Compare Files Line by Line in Linux | diff Command
      In the world of Linux, managing and comparing files is a common task for system administrators and developers alike. The ability to compare files line by line is crucial for identifying differences, debugging code, and ensuring the integrity of data. One powerful tool that facilitates this process i
      9 min read

    • Head Command in Linux With Examples
      Need to quickly view the beginning of a file in Linux? The head command is your best option. This essential command-line tool enables users, developers, and system administrators to preview the start of log files, configuration files, CSV datasets, and other text documents in seconds. The head comma
      6 min read

    Text Processing and Manipulation

    • 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 sort lines in text files in Linux | sort Command
      SORT command is used to sort a file, arranging the records in a particular order. By default, the sort command sorts file assuming the contents are ASCII. Using options in the sort command can also be used to sort numerically.  SORT command sorts the contents of a text file, line by line.sort is a s
      7 min read

    • AWK command in Unix/Linux with examples
      Awk is a scripting language used for manipulating data and generating reports. The awk command programming language requires no compiling and allows the user to use variables, numeric functions, string functions, and logical operators. Awk is a utility that enables a programmer to write tiny but eff
      8 min read

    • Sed Command in Linux/Unix With Examples
      The SED command is one of the most powerful commands used during the process of text processing in Linux/Unix operating systems. The SED command is typically invoked for executing operations such as replace and search, text manipulation, and stream editing. With SED, you can manipulate text files wi
      9 min read

    • cut command in Linux with examples
      The cut command in linux is a command for cutting out the sections from each line of files and writing the result to standard output. It can be used to cut parts of a line by byte position, character, and field. The cut command slices a line and extracts the text. It is necessary to specify an optio
      9 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

    • echo command in Linux with Examples
      The echo command in Linux is a built-in command that allows users to display lines of text or strings that are passed as arguments. It is commonly used in shell scripts and batch files to output status text to the screen or a file. Syntax of `echo` command in Linuxecho [option] [string]Here, [option
      3 min read

    • export command in Linux with Examples
      The 'export' command is one of the essential built-in commands in the Bash shell, allowing users to manage environment variables effectively. It is defined in POSIX standards, which state that the shell will assign the export attribute to specified variables, causing them to be included in the envir
      3 min read

    • source Command in Linux with Examples
      If you're new to the world of Linux, you might have heard about commands that do various tasks, but some like the 'source' command might seem a bit confusing at first. Don't worry; let's break it down step by step. What is the Source Command?The source command in Linux is like a magic wand that lets
      7 min read

    • How to Display Command History in Linux | history Command
      The history command in Linux is essential for terminal users, enabling them to view, search, and manipulate previously executed commands. Now, mastering this Linux command allows for efficient commands of commands, automation of repetitive tasks, and troubleshooting without the need to retype length
      4 min read

    Help and Information

    • apropos command in Linux with Examples
      Linux/Unix comes with a huge number of commands and thus it become quite difficult sometimes to remember each and every command. apropos command becomes useful in such cases. apropos command helps the user when they don't remember the exact command but knows a few keywords related to the command tha
      3 min read

    • info command in Linux with Examples
      info command reads documentation in the info format. It will give detailed information for a command when compared with the man page. The pages are made using the Texinfo tools which can link with other pages, create menus, and easy navigation. Here, we will explore the functionality of the info com
      3 min read

    • How to Create and Use Alias Command in Linux
      Imagine you're lost in a maze of complicated Linux commands. You stumble upon a secret doorway marked "Alias," and inside you find shortcuts to all your favorite commands! That's what creating aliases is like. You get to make your own mini-commands for the long ones you use all the time, making thin
      6 min read

    • uname command in Linux with Examples
      Linux, renowned for its open-source flexibility and powerful performance, offers a range of commands that reveal the inner workings of your system. Among these, the 'uname' command stands out as a versatile tool that provides key details about your Linux machine. Here, we will learn the basics of th
      4 min read

    • df command in Linux with Examples
      Ever felt the chilling fear of a "disk full" error message on your Linux machine? Fear not, for the mighty df command stands ready to guide you through the treacherous terrain of disk space management! This article delves deep into the df command, equipping you with the knowledge and skills to navig
      5 min read

    • du command in Linux with examples
      The `du` command in Linux is a powerful utility that allows users to analyze and report on disk usage within directories and files. Whether you're trying to identify space-hogging directories, manage disk space efficiently, or simply gain insights into storage consumption, the du command provides va
      6 min read

    • How to Mount File System in Linux | mount Command
      Working with file systems is a fundamental part of managing a Linux system, and knowing how to mount them is a skill every Linux user should have. Whether you’re connecting a USB drive, accessing a network share, or setting up a new partition, the mount command is your go-to tool for making file sys
      7 min read

    • ln command in Linux with Examples
      The 'ln' command in Linux is a powerful utility that allows you to create links between files. These links can either be hard links or soft (symbolic) links. If you're unfamiliar with these concepts, check out our detailed guide on Hard and Soft Links in Linux to understand their differences, use ca
      3 min read

    System Administration and Control

    • How to Display Path of an Executable File in Linux | Which Command
      In Linux finding the exact path of an excutable file can be crucial for the system adminstration, scripting and as well for troubleshooting. The `which` command helps with providing a simple and effective way to locate the executable files within the directories that are listed in your system. In th
      6 min read

    • whereis command in Linux with Examples
      'whereis' command is used to find the location of source/binary file of a command and manuals sections for a specified file in Linux system. If we compare 'whereis' command with 'find' command they will appear similar to each other as both can be used for the same purposes but 'whereis' command prod
      4 min read

    • locate command in Linux with Examples
      locate command in Linux is used to find the files by name. There are two most widely used file-searching utilities accessible to users called to find and locate. The locate utility works better and faster than the find command counterpart because instead of searching the file system when a file sear
      7 min read

    • How to Display and Set Date and Time in Linux | date Command
      Unlock the full potential of the date command in Linux—a versatile tool that does more than just show the current date and time. With this command, you can set your system’s clock, synchronize time across networks, and even calculate past or future dates for tasks like scheduling or logging. In this
      8 min read

    • cal command in Linux with Examples
      The 'cal' command in Linux is a versatile tool that displays calendars directly in the terminal. If a user wants a quick view of the calendar in the Linux terminal, 'cal' is the command for you. Here’s a look at the usage and features of 'cal' command in Linux. What is the 'cal' command?cal command
      2 min read

    • How to Start, Stop and Restart Services in Linux Using systemctl Command
      System services play a crucial role in the functioning of a Linux system, handling various tasks and processes in the background. systemctl is a powerful command-line tool that allows users to manage these services effectively. In this article, we will explore the basics of using systemctl to start,
      9 min read

    • shutdown command in Linux with Examples
      The `shutdown` operation in Linux is a crucial command for managing system power states, allowing administrators to halt safely, power off, or reboot the system. This command provides flexibility in scheduling downtimes, ensuring minimal disruption to users and processes. In this article, we will ex
      5 min read

    User and Group Management

    • init command in Linux with examples
      The init process is the parent of all processes in Linux, identified by the process ID (PID) of 1. It is the first process that starts when a computer boots up and continues to run until the system shuts down. The term init stands for "initialization," and its primary role is to create and manage pr
      4 min read

    • How to add User in Linux | useradd Command
      useradd is a command in Linux that is used to add user accounts to your system. It is just a symbolic link to adduser command in Linux and the difference between both of them is that useradd is a native binary compiled with the system whereas adduser is a Perl script that uses useradd binary in the
      5 min read

    • usermod command in Linux with Examples
      usermod command or modify user is a command in Linux that is used to change the properties of a user in Linux through the command line. After creating a user we have to sometimes change their attributes like password or login directory etc. so in order to do that we use the Usermod command. The info
      4 min read

    • How to Delete User in Linux | userdel Command
      Managing user accounts is an essential aspect of Linux system administration. Understanding how to delete a user in Linux is crucial, whether you need to remove an unused account, revoke access for a departing employee, or clean up your system for security reasons. Here, we will explore the 'userdel
      6 min read

    • How to Create a new group in Linux | groupadd command
      In the Linux operating system, user management is a crucial aspect of system administration. One of the fundamental tasks is creating and managing user groups. Groups in Linux allow administrators to organize and control user access to various resources and files. The groupadd command is a powerful
      7 min read

    • groupmod command in Linux with examples
      groupmod command in Linux is used to modify or change the existing group on Linux system. It can be handled by superuser or root user. Basically, it modifies a group definition on the system by modifying the right entry in the database of the group. Syntax: groupmod [option] GROUP Files: The groupmo
      2 min read

    • How to Delete a Group in Linux | groupdel command
      Group management is a crucial aspect of Linux system administration, and understanding how to create, modify, and delete groups is essential for maintaining a secure and organized environment. In this article, we will delve into the process of deleting a group in Linux using the 'groupdel' command.
      3 min read

    • How to Change User Password in Linux | passwd Command
      Securing user accounts is a fundamental aspect of maintaining a robust and secure Linux system. One essential task is changing user passwords regularly to prevent unauthorized access. The passwd command in Linux provides a straightforward and effective way to modify user passwords. This article will
      8 min read

    • Difference Between su and su - Command in Linux
      As a new Linux user, you may always face confusion regarding the difference between `su` command and `su -` command. In Linux, the `su` command is used to switch to another user account. However, there are two variations of the `su` command: `su` and `su -` (su hyphen). Table of Content What is Linu
      6 min read

    Privilege and Security Management

    • chroot command in Linux with examples
      The 'chroot' command in Linux and Unix-like systems is used to change the root directory for the current running process and its child processes. This change creates a restricted environment, often referred to as a "chroot jail" or "jailed directory," where processes are limited to accessing only fi
      3 min read

    • file command in Linux with examples
      The 'file' command in Linux is a vital utility for determining the type of a file. It identifies file types by examining their content rather than their file extensions, making it an indispensable tool for users who work with various file formats. The file type can be displayed in a human-readable f
      3 min read

    • hexdump command in Linux with examples
      The 'hexdump' command in Linux is a versatile utility used to display file content or data from standard input in a human-readable format. It is invaluable for programmers and system administrators for debugging binary data, analyzing file structures, and verifying data integrity. Here we will get a
      6 min read

    • wc command in Linux with examples
      wc stands for word count. As the name implies, it is mainly used for counting purpose. It is used to find out number of lines, word count, byte and characters count in the files specified in the file arguments.By default it displays four-columnar output.First column shows number of lines present in
      6 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

    • script command in Linux with Examples
      The 'script' command in Linux is a versatile tool that allows you to record all terminal activities, including inputs and outputs, making it a valuable resource for developers, system administrators, educators, and anyone who needs to document terminal sessions. This command captures everything disp
      6 min read

    • How To Generate SSH Key With ssh-keygen In Linux?
      Secure Shell(SSH) is a cryptographic network protocol used for operating remote services securely. It is used for remote operation of devices on secure channels using a client-server architecture that generally operates on Port 22. SSH is the successor of Telnet. SSH uses public and private keys to
      4 min read

    Process Management and Control

    • 'crontab' in Linux with Examples
      If you do manually backups , update logs, or restart services on your Linux machine? Imagine that running repetitive tasks overnight so your machine works for you while you rest. Here crontab, the native job scheduler in Linux, which enables users to easily automate commands, scripts, and system tas
      9 min read

    • at Command in Linux with Examples
      In the world of Linux operating systems, there exists a powerful tool known as the "at command." The 'at' command provides users with the ability to schedule tasks to be executed at a later time, offering a convenient way to automate processes without manual intervention. Whether you need to run a s
      9 min read

    • nohup Command in Linux with Examples
      Every command in Linux starts a process at the time of its execution, which automatically gets terminated upon exiting the terminal. Suppose, you are executing programs over SSH and if the connection drops, the session will be terminated, all the executed processes will stop, and you may face a huge
      5 min read

    • bg command in Linux with Examples
      In Linux, the bg command is a useful tool that allows you to manage and move processes between the foreground and background. It's especially helpful when you want to multitask in the terminal by placing a process in the background, enabling you to continue using the terminal for other commands whil
      3 min read

    • fg command in Linux with examples
      The fg command in Linux is used to bring a background job into the foreground. It allows you to resume a suspended job or a background process directly in the terminal window, so you can interact with it. Syntaxfg [job_spec]The job_spec is a way to refer to the background jobs that are currently run
      3 min read

    • Process Control Commands in Unix/Linux
      Process control commands in Unix are: bg - put suspended process into background fg - bring process into foreground jobs - list processes bg Command : bg is a process control command that resumes suspended process while keeping them running in the background. User can run a job in the background by
      3 min read

    • Shell Script to Demonstrate Wait Command in Linux
      Wait command is one of the process management commands. There are different process commands in Linux mainly 5 commands are widely used which are ps, wait, sleep, kill, exit. ps is an acronym for process status. It displays information about the active processes. wait command will suspend execution
      4 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