diff --git a/Cloud/Azure/AZ-104--Administrator/ms-learn/README.md b/Cloud/Azure/AZ-104--Administrator/ms-learn/README.md index 2df0efa..3759983 100644 --- a/Cloud/Azure/AZ-104--Administrator/ms-learn/README.md +++ b/Cloud/Azure/AZ-104--Administrator/ms-learn/README.md @@ -11,3 +11,4 @@ * [Use Azure Resource Manager](./prerequisites-for-azure-admin--01-use-azure-resource-manager.md) * [Introduction to Azure Cloud Shell](./prerequisites-for-azure-admin--02-intro-to-azure-cloud-shell.md) * [Introduction to Bash](./prerequisites-for-azure-admin--03-intro-to-bash.md) +* [Introduction to PowerShell](./prerequisites-for-azure-admin--04-intro-to-powershell.md) \ No newline at end of file diff --git a/Cloud/Azure/AZ-104--Administrator/ms-learn/prerequisites-for-azure-admin--03-intro-to-bash.md b/Cloud/Azure/AZ-104--Administrator/ms-learn/prerequisites-for-azure-admin--03-intro-to-bash.md index 94d8edd..7b2d721 100644 --- a/Cloud/Azure/AZ-104--Administrator/ms-learn/prerequisites-for-azure-admin--03-intro-to-bash.md +++ b/Cloud/Azure/AZ-104--Administrator/ms-learn/prerequisites-for-azure-admin--03-intro-to-bash.md @@ -41,3 +41,83 @@ Wildcards are symbols that represent one or more characters in Bash commands. Th ```bash ls *.png ``` + +### Bash Commands and Operators + +#### `ls [-a] [-l]` command + +`ls` lists the contents of your current directory or the directory specified in an argument to the command. By itself, it lists the files and directories in the current directory. + +#### `cat` command + +`cat` shows the contents of a file. + +```bash +cat /etc/os-release +``` + +This is a useful command because it tells you which Linux distribution you're running: + +```bash +NAME="Ubuntu" +VERSION="18.04.2 LTS (Bionic Beaver)" +ID=ubuntu +ID_LIKE=debian +PRETTY_NAME="Ubuntu 18.04.2 LTS" +VERSION_ID="18.04" +HOME_URL="https://www.ubuntu.com/" +SUPPORT_URL="https://help.ubuntu.com/" +BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" +PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" +VERSION_CODENAME=bionic +UBUNTU_CODENAME=bionic +``` + +#### `sudo` command + +Some Bash commands can only be run by the root user; a system administrator or superuser. If you try one of these commands without sufficient privileges, it fails. + +You don't want to run as root most of the time; it's too dangerous. To run commands that require admin privilege without logging in as a superuser, you'll preface the commands with `sudo`. + +`sudo` stands for "superuser do." When you use it, you're telling the shell that for this one command, you're acting with the root-user level of permission. + +#### `cd`, `mkdir`, and `rmdir` commands + +`cd` stands for "change directory," and it does exactly what the name suggests: it changes the current directory to another directory. It enables you to move from one directory to another just like its counterpart in Windows. + +You can create directories by using the `mkdir` command. + +The `rmdir` command deletes (removes) a directory, but only if it's empty. If it's not empty, you'll get a warning instead. + +#### `rm [-r]` command +The `rm` command is short for "remove." As you'd expect, `rm` deletes files. + +#### `cp [-r] [-i]` command +The `cp` command copies not just files, but entire directories (and subdirectories) if you want. + +#### `ps [-ef]` command + +The ps command gives you a snapshot of all the currently running processes. By itself, with no arguments, it shows all your shell processes; in other words, not much. + +`-e` lists all running processes, and there are typically many of them. + +For a more comprehensive look at what processes are running in the system, use the `-ef` flag. + +#### `w` command + +Users come, users go, and sometimes you get users you don't want at all. Sysadmins are also expected to know who's logged in, and who shouldn't be. + +To find out who's on your servers, Linux provides the `w` (for "who") command. It displays information about the users currently on the computer system and those users' activities. `w` shows user names, their IP addresses, when they logged in, what processes they're currently running, and how much time those processes are consuming. It's a valuable tool for sysadmins. + +#### `pwd` command + +`pwd` stands for "print working directory." + +### Bash I/O operators + +You can do a lot in Linux just by exercising Bash commands and their many options. But you can really get work done when you combine commands by using I/O operators: + +* `<` for redirecting input to a source other than the keyboard. +* `>` for redirecting output to destination other than the screen. +* `>>` for doing the same, but appending rather than overwriting. +* `|` for piping output from one command to the input of another. diff --git a/Cloud/Azure/AZ-104--Administrator/ms-learn/prerequisites-for-azure-admin--04-intro-to-powershell.md b/Cloud/Azure/AZ-104--Administrator/ms-learn/prerequisites-for-azure-admin--04-intro-to-powershell.md new file mode 100644 index 0000000..daee987 --- /dev/null +++ b/Cloud/Azure/AZ-104--Administrator/ms-learn/prerequisites-for-azure-admin--04-intro-to-powershell.md @@ -0,0 +1,2 @@ +# Introduction to PowerShell +