

{"id":110395,"date":"2022-07-25T11:55:25","date_gmt":"2022-07-25T06:25:25","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=110395"},"modified":"2022-07-25T12:02:14","modified_gmt":"2022-07-25T06:32:14","slug":"sudo-command-in-linux","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/","title":{"rendered":"Sudo Command in Linux"},"content":{"rendered":"<p>In this article, you will learn all there is to the sudo command in Linux-based operating systems. We will go through what the sudo command is, why it is used, a brief history of it, syntax, options, and a few practical examples of the sudo command.<\/p>\n<h3>What is sudo command in Linux?<\/h3>\n<p>Sudo is the abbreviation for \u201cSuper User Do\u201d. It is a command-line-based utility in Linux-based operating systems that enables users to run programs with the security privileges of another user, in other words, the superuser.<\/p>\n<p>Now a question may arise as to what a superuser is? Well, in Linus distributions the root user is called the superuser. Why? Because the root user is virtually almighty! he\/she has unrestricted access to all the commands, files directories, and resources. Name it, they own it!<\/p>\n<p>We know that apart from the root user, there can also be other guest users in the operating system, and if these users want to operate something that requires the root user privileges, they can simply use the SUDO command to gain their role for a temporary time to execute that command.<\/p>\n<p>Usage of the SUDO command gives you the authority of the root user, except only once. It is like being a superhuman for a limited time period! To give you a better idea, the superhuman is the exact same thing as \u201crun as administrator\u201d in Windows operating system.<\/p>\n<p>The sudo command lets you have multiple administrators. The users who use the sudo command need to have an entry in the sudoers file, this file is located at \u201c\/etc\/sudoers\u201d. Therefore, if you have to use the sudo command, you have to have an entry, if you don\u2019t you can simply add it.<\/p>\n<p>If you add the prefix \u201csudo\u201d to any command, the terminal will run the command with elevated privileges or gives the user the required permissions to execute a command as another user.<\/p>\n<h3>History of Linux sudo command<\/h3>\n<p>The very first version of sudo was written at the Department of Computer Science at buffalo by Robert Coggeshall and Cliff Spencer in 1980. Later, Robert Coggeshall brought sudo along with him to the university of colorado.<\/p>\n<p>Between the years 1986 and 1993, the features and code were considerably changed. These changes were made by the IT staff of the computer science department at the University of Colorado Boulder. The current version of sudo has been publicly maintained by the OpenBSD developer Todd C Miller.<\/p>\n<h3>Syntax of the sudo command<\/h3>\n<p>The syntax for the sudo command is very simple:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo &lt;command&gt;<\/pre>\n<p>The sudo command is simply used as a prefix to the main command that needs elevated privileges to run.<\/p>\n<h3>Options used with linux sudo command<\/h3>\n<p>Despite sudo only being a prefix for the main command, you can also run the sudo command alone by using a couple of options. Let us take a look at the options available with the standalone use of the sudo command:<\/p>\n<h4>1. -l<\/h4>\n<p>This option prints the command allowed by the user on the current host.<\/p>\n<h4>2. -L<\/h4>\n<p>This option lists out the parameters set in a \u2018Defaults\u2019 line with a short description for each<\/p>\n<h4>3. -v<\/h4>\n<p>This option makes sudo update the user\u2019s timestamp, prompting for the user&#8217;s password if necessary.<\/p>\n<h4>4. -k<\/h4>\n<p>This option invalidates the user\u2019s timestamp by setting the time on it to the epoch.<\/p>\n<h4>5. -K<\/h4>\n<p>This option removes the user\u2019s timestamp completely.<\/p>\n<h4>6. -b<\/h4>\n<p>This option tells sudo to run the given command in the background.<\/p>\n<h4>7. -p<\/h4>\n<p>This option allows you to override the default password to prompt and use a custom password.<\/p>\n<h4>8. -c<\/h4>\n<p>This option runs the specified command with resources limited by the specified login class.<\/p>\n<h4>9. -a<\/h4>\n<p>This option uses the specified authentication type when validating the user.<\/p>\n<h4>10. -u<\/h4>\n<p>This option runs the specified command as a user other than the root.<\/p>\n<h4>11. -s<\/h4>\n<p>This option runs the shell and specifies the \u2018shell\u2019 environment variable if it is set.<\/p>\n<h4>12. -H<\/h4>\n<p>This option sets the \u2018home\u2019 environment variable to the \u2018home directory\u2019 of the target user as specified in the password.<\/p>\n<h4>13. -P<\/h4>\n<p>This option preserves the user\u2019s group vector.<\/p>\n<h4>14. -h<\/h4>\n<p>This option prints the help menu as shown below<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/help-menu-of-the-sudo-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110448\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/help-menu-of-the-sudo-command.webp\" alt=\"help menu of the sudo command\" width=\"812\" height=\"713\" \/><\/a><\/p>\n<h4>15. -t<\/h4>\n<p>This option causes the new security context to have the type specified.<\/p>\n<h4>16. -S<\/h4>\n<p>This option takes the password from STDIN (standard input) instead of the terminal device.<\/p>\n<h4>17. \u2013<\/h4>\n<p>This flag indicates that sudo should stop [rocessing command line arguments.<\/p>\n<h4>18. -r<\/h4>\n<p>This option causes the new security context to have the role specified.<\/p>\n<h4>19. -V<\/h4>\n<p>This option prints information about the version of sudo you are using.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/version-of-the-sudo-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110449\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/version-of-the-sudo-command.webp\" alt=\"version of the sudo command\" width=\"500\" height=\"166\" \/><\/a><\/p>\n<h3>Environment variables used by Linux SUDO<\/h3>\n<p>Before we proceed further, let us look at the environment variables that the sudo command uses.<\/p>\n<h4>1. PATH<\/h4>\n<p>This variable sets to a sane value if SECURE_PATH is set.<\/p>\n<h4>2. SHELL<\/h4>\n<p>This variable determines the shell to run with the option \u201c-s\u201d.<\/p>\n<h4>3. USER<\/h4>\n<p>This variable sets to the target user. It uses the root user unless is another user is specified with the option \u201c-u\u201d<\/p>\n<h4>4. SUDO_PROMPT<\/h4>\n<p>This variable prompts the default password.<\/p>\n<h4>5. SUDO_COMMAND<\/h4>\n<p>This variable takes the value of the command run by sudo.<\/p>\n<h4>6. SUDO_USER<\/h4>\n<p>This variable takes the value of the login of the user who invoked sudo<\/p>\n<h4>7. SUDO_UID<\/h4>\n<p>This variable takes the value of the uid of the user who invoked sudo<\/p>\n<h4>8. SUDO_GID<\/h4>\n<p>This variable takes the value of the gid of the user who invoked sudo<\/p>\n<h4>9. SUDO_PS1<\/h4>\n<p>This variable sets PS1 to its value.<\/p>\n<h3>Installing sudo<\/h3>\n<p>The reason I did not include this, in the beginning, is because sudo already comes preinstalled in all the distributions of Linux. Nonetheless, if you don\u2019t have sudo in your Linux based operating system used the command below with respect to your Linux Distro<\/p>\n<h4>Installing sudo on Debian based Linux distros<\/h4>\n<p>If you want to download sudo on Debian based operating systems like Ubuntu, kali, MX Linux, Mint, deepen, etc, use the command below:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">apt install sudo<\/pre>\n<h4>Installing sudo on Fedor based Linux distros<\/h4>\n<p>If you want to download sudo on Fedora-based operating systems like RHEL, CentOS, Qubes, berry Linux, clearOS, etc, use the command below:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">yum install sudo<\/pre>\n<h3>Design of linux SUDO command<\/h3>\n<p>1. after authentication the system requests the claimed command, When the configuration file allows the user access,<\/p>\n<p>2. The sudo command is configured for logging every single command run. This is one such feature of the sudo command\u2019s auditing and security feature.<\/p>\n<p>3. Once, a user shots for invoking the sudo command without being listed inside the configuration file.<\/p>\n<p>4. The entry of a user in the sudoers file would be saved inside the system and the root user would be informed via mail.<\/p>\n<h3>Granting sudo privileges<\/h3>\n<p>To use the sudo command, a must be in the sudo, wheel, or sudoers group. By default, the system grants the superuser privileges to its user if it has only a single user (not having multiple users). However, If a system has multiple users, it excludes a few of them from having sudo privileges.<\/p>\n<p>Nonetheless, you can always give a particular user sudo privileges by using the commands shown below:<\/p>\n<h4>Giving sudo privileges in Debian based Linux distros<\/h4>\n<p>To give a particular user elevated permissions in Debian based Linux distributions like Ubuntu, kali, MX Linux, Mint, deepen, etc, use the command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">usermod -aG sudo &lt;username&gt;<\/pre>\n<h4>Giving sudo privileges in Fedora-based Linux distros<\/h4>\n<p>To give a particular user elevated permissions in Debian based Linux distributions like RHEL, CentOS, Qubes, berry Linux, clearOS, etc, use the command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">usermod -aG sudo &lt;username&gt;<\/pre>\n<h3>Using the sudoer file to grant permissions<\/h3>\n<p>The method shown above is one method of granting SUDO privileges to a user, another method is the permanently write it in the sudoers file. To do so, type the command \u201csudo vi sudo\u201d in the terminal.<\/p>\n<p>The configuration file of sudo opens. If you want to grant sudo privileges to a specific user on your computer, type the following command in the configuration file:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;username&gt; ALL=(ALL:ALL) ALL<\/pre>\n<p>After successfully writing the line, press \u201cctrl\u201d + \u201cX\u201d to save and exit. Now you have successfully given a user SUDO privileges.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/command-to-open-the-sudoers-file.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110450\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/command-to-open-the-sudoers-file.webp\" alt=\"command to open the sudoers file\" width=\"492\" height=\"89\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/making-changes-in-the-sudoers-file.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110451\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/making-changes-in-the-sudoers-file.webp\" alt=\"making changes in the sudoers file\" width=\"780\" height=\"521\" \/><\/a><\/p>\n<h3>SU vs SUDO<\/h3>\n<p>Before we proceed further and see the usage of the sudo command let us take a moment to compare another very similar command \u201cSU\u201d with the SUDO command. Why are we comparing? Well, we are doing so because these are the only 2 commands used in Linux to gain momentary access or elevated privileges.<\/p>\n<p>The SUDO command stands for \u201cSuper User Do\u201d whereas the SU command stands for \u201cSubstitute user\u201d . the most distinguishable difference between the 2 is that the SU command is used on its own or mostly with the substitute username as a parameter.<\/p>\n<p>SUDO on the other hand is a prefix for another command. Sudo is the most loved of the 2, because of its ability to define constraints on whether a user can use sudo and with what command he can use it.<\/p>\n<h3>Using the sudo command<\/h3>\n<p>Ahh! Finally the practical section! Let us see the different ways oh how the sudo command is used for different purposes.<\/p>\n<h4>Basic usage of the sudo command<\/h4>\n<p>The traditional usage of sudo id to elevate permissions. For example, if you want to update your system (using the command apt-get update), you will not get be able to do it since you don\u2019t have root permissions and hence need the prefix \u201cSUDO\u201d.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/trying-to-update-packages-without-sudo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110452\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/trying-to-update-packages-without-sudo.webp\" alt=\"trying to update packages without sudo\" width=\"780\" height=\"107\" \/><\/a><\/p>\n<p>In the above output, I could not update the command since I did not have superuser permissions, however, If I use sudo, I can:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/updating-packages-with-the-sudo-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110453\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/updating-packages-with-the-sudo-command.webp\" alt=\"updating packages with the sudo command\" width=\"780\" height=\"458\" \/><\/a><\/p>\n<h4>Run command as a different user<\/h4>\n<p>I can also run a specific command as another user without actually being the other user! For example, If I run the \u201cwhoami\u201d command from mu username, I get the expected output:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/checking-current-user.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110456\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/checking-current-user.webp\" alt=\"checking current user\" width=\"534\" height=\"118\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Now from my own account, I can use sudo and run the same command as the root user:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/changing-user-temporarily-by-using-the-sudo-command.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110457\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/changing-user-temporarily-by-using-the-sudo-command.webp\" alt=\"changing user temporarily by using the sudo command\" width=\"618\" height=\"153\" \/><\/a><\/p>\n<h4>Executing the previous command with sudo<\/h4>\n<p>We can also execute the previous command in Linux by pairing \u201c!!\u201d with sudo:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/executing-the-previous-command-with-sudo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110455\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/executing-the-previous-command-with-sudo.webp\" alt=\"executing the previous command with sudo\" width=\"780\" height=\"147\" \/><\/a><\/p>\n<h4>Running multiple commands with sudo<\/h4>\n<p>We can also run multiple commands at once using sudo. We simply combine the commands with a semicolon (;) ans prefix it with a sudo.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/running-multiple-commands-with-sudo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110454\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/running-multiple-commands-with-sudo.webp\" alt=\"running multiple commands with sudo\" width=\"780\" height=\"129\" \/><\/a><\/p>\n<h4>Adding text to an already existing file<\/h4>\n<p>To add a string of text to a file that already exists, use the following syntax:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">echo \u2018text\u2019 | sudo tee -a &lt;file path&gt;<\/pre>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/adding-text-to-an-already-existing-file.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-110458\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/adding-text-to-an-already-existing-file.webp\" alt=\"adding text to an already existing file\" width=\"780\" height=\"93\" \/><\/a><\/p>\n<p>To check if the line has been successfully added or not, you can use the cat command.<\/p>\n<h4>Switching to the root user<\/h4>\n<p>You can also change to the root user by using the command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo bash<\/pre>\n<p>&nbsp;<\/p>\n<p>These commands don\u2019t even scratch the surface of the sudo command, in fact, we cannot show its great prowess simply by using commands.<\/p>\n<h3>Summary<\/h3>\n<p>As you have seen, the sudo command is a really powerful command that gives any user elevated permissions. You have now learned what the sudo command is, a brief history of it, the syntax, options, and environment variables of the sudo command, how to install it, and the design of it.<\/p>\n<p>We have also seen w methods of how to give sudo privileges to a specific user, compared it with the SU command, and seen some important usage of the sudo command.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, you will learn all there is to the sudo command in Linux-based operating systems. We will go through what the sudo command is, why it is used, a brief history of&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":110446,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[35],"tags":[27059],"class_list":["post-110395","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","tag-sudo-command-in-linux"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Sudo Command in Linux - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn what the linux sudo command is, its use, history, syntax, options, and practical examples of the sudo command.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sudo Command in Linux - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn what the linux sudo command is, its use, history, syntax, options, and practical examples of the sudo command.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-07-25T06:25:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-07-25T06:32:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/sudo-command-in-linux.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Sudo Command in Linux - DataFlair","description":"Learn what the linux sudo command is, its use, history, syntax, options, and practical examples of the sudo command.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"Sudo Command in Linux - DataFlair","og_description":"Learn what the linux sudo command is, its use, history, syntax, options, and practical examples of the sudo command.","og_url":"https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2022-07-25T06:25:25+00:00","article_modified_time":"2022-07-25T06:32:14+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/sudo-command-in-linux.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9"},"headline":"Sudo Command in Linux","datePublished":"2022-07-25T06:25:25+00:00","dateModified":"2022-07-25T06:32:14+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/"},"wordCount":1835,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/sudo-command-in-linux.webp","keywords":["Sudo Command in Linux"],"articleSection":["Linux Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/","url":"https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/","name":"Sudo Command in Linux - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/sudo-command-in-linux.webp","datePublished":"2022-07-25T06:25:25+00:00","dateModified":"2022-07-25T06:32:14+00:00","description":"Learn what the linux sudo command is, its use, history, syntax, options, and practical examples of the sudo command.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/sudo-command-in-linux.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2022\/06\/sudo-command-in-linux.webp","width":1200,"height":628,"caption":"sudo command in linux"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/sudo-command-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Linux Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/linux\/"},{"@type":"ListItem","position":3,"name":"Sudo Command in Linux"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/b49855299264df5e27e3ec6c2cd9fde9","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ef46b745ddad2fad690af626c6ef29b91809ad0a9f5ef398d07817d8cad042f5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team is a group of passionate educators and industry experts dedicated to providing high-quality online learning resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With years of experience in the field, the team aims to simplify complex topics and help learners advance their careers. At DataFlair, we believe in empowering students and professionals with the knowledge and skills needed to thrive in today\u2019s fast-paced tech industry. Follow us for Free courses, expert insights, tutorials, and practical tips to boost your learning journey.","url":"https:\/\/data-flair.training\/blogs\/author\/datafbdad\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/110395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=110395"}],"version-history":[{"count":4,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/110395\/revisions"}],"predecessor-version":[{"id":110460,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/110395\/revisions\/110460"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/110446"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=110395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=110395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=110395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}