Command Line Interface (CLI) tutorial Part 1 Login, ls/dir, help, cd, and cp/mv --- So you want to use the CLI. Maybe you want to look like a 1337 hacker or just want a simple text interface or just want to mess around. Whatever the reason, welcome. In this lesson, I'm going to go over the bare basics in CLI: logging in, viewing directories/folders, changing folders, copying/pasting files, and getting help. You can use Linux TTY (Ctrl + Alt + F1), a terminal emulator in the GUI (Xfce Terminal, UXTerm), Windows Command Prompt, or Windows Powershell. Powershell is closer to Linux commands, so keep that in mind. Command Prompt is similar but typically longer with different keywords. 1. Login (Windows users can skip to step 2) I`m not going over how to create an account, but logging into a terminal via emulator or TTY is pretty straightforward. Type your username (e.g. mint), press enter, and type your password (e.g. pass123). Your password will not show up as stars or anything for security reasons. Assuming you did everything right, you should be greeted with a prompt that may look like `mint@laptop ~>` 2. ls (dir for Windows Command Prompt (WCP)) Now you're just faced with a prompt. Entering `go to my documents` unfortunately won't get you anywhere. What you can do is look at a listing of the contents of the folder. For this, type `ls` and press enter. You should get a few columns of filenames in your home folder (~). There may be nothing in your home folder, but assuming the screen doesn't spit out an error, you`re good. To view all the files and directories in a folder, type `ls -al`. The `-al` is a common CLI concept known as flags or options; in this case, `l` is for `long` which gives you more details in the list and `a` is for including all files and folders. For WCP, you`re going to want to use `dir.` It's most similar to `ls -al` but not quite. WCP has a different flag system in that they`re prefaced with a / instead of a -.When I use dir, I typically type `dir/ogn` which is basically saying "list directory contents, and 'o'rder 'g'rouping folders first by 'n'ame. 3. Getting help Before I go further, I want to show you how to get help for a specific program. In Linux, it's usually ` -h` ` --help` or `man `. For example, typing `man ls` will take you to the `man`ual for ls. Most commands are well documented and if you have the patience to read for a minute or two, you can find what you`re looking for. You can use and b to navigate up and down through the document; up, down, pgup, and pgdown also work. I cannot stress how useful these help commands are: they can get you out of a pickle or increase your productivity just by reading them. For WCP, the style is `help `. It's analogous to the Linux help. 4. Navigating the filesystem To change folders, which I will start calling directories or dirs from now on to be in line with the commands, you type `cd `. CD stands for 'c'hange 'd'irectory.In Linux the root folder, the base of the system, is `/`. So if you wanted to go to that dir, you`d type `cd /`. Then you can see the contents with `ls`. I don`t recommend modifying any of the files or dirs there since you can really break your operating system if you do, so to change back to your home directory, type `cd ~` or simple `cd`. Most Linux systems have cd change to the home directory if no argument is given. Another way of getting to your home directory is to type `cd /home/` (e.g. `cd /home/mint`). In WCP, cd works the same, although there is no real root (just My Computer in Windows Explorer). To switch drives (usually Windows is on C:\), you just have to type the drive letter and a colon, so switching to the D drive would be simply `D:` 5. Copying and moving files Copying and moving files in CLI is easy; for Linux, you just type `cp ` e.g. `cp myfile.txt myawesomefolder/`. To move it, simply repace `cp` with `mv`. The only difference is moving copies the file to the new location then deletes the original file, while copy doesn't delete the original file. You can copy whole dirs with the `-r` ('r'ecursive') flag. In WCP, cp is copy and mv is move e.g. `move file1 folder1\`. Note the slash direction: Windows uses the other slash for directories. Another copying command in WCP is robocopy, which will copy a folder and all the new/updated files to the destination. This is especially helpful with backing up files. To simulate robocopy on Linux, the best I know is "cp -ruv "