💻 Command Line: The command line is a tool or interface for interacting with a computer using only text rather than the mouse. Command-Line is an essential tool for software development. We can execute a wide variety of programs on our computer through this. In this tutorial, we are going to learn the necessary UNIX commands for development. command is a type of command that is used in LINUX and macOS. UNIX To run some basic UNIX command in windows you can download Git Command Line Interface from Git SCM . 🔰 Getting Started: ✨ Let's start to learn (can use it as a reference guide) ... ✔ Check the Current Directory ➡ : pwd On the command line, it's important to know the directory we are currently working on. For that, we can use command. pwd It shows that I'm working on my directory. Desktop ✔ Display List of Files ➡ : ls To see the list of files and directories in the current directory use command in your CLI. ls Shows all of my files and directories of my directory. Desktop • To show the contents of a directory pass the directory name to the command i.e. . ls ls directory_name • Some useful command options:- ls : list all files including hidden file starting with '.' ls -a : list with the long format ls -l : list long format including hidden files ls -la ✔ Create a Directory ➡ : mkdir We can create a new folder using the command. To use it type . mkdir mkdir folder_name Use command to see the directory is created or not. ls I create a directory in my working directory i.e. directory. cli-practice Desktop ✔ Move Between Directories ➡ : cd It's used to change directory or to move other directories. To use it type . cd directory_name Can use command to confirm your directory name. pwd Change my directory to the directory. And the rest of the tutorial I'm gonna work within this directory. cli-practice ✔ Parent Directory ➡ : .. We have seen command to change directory but if we want to move back or want to move to the parent directory we can use a special symbol after command, like cd .. cd cd .. ✔ Create Files ➡ : touch We can create an empty file by typing . It's going to create a new file in the current directory (the directory you are currently in) with your provided name. touch file_name I create a file in my current working directory. Again you can use command to see the file is created or not. hello.txt ls Now open your file in your text editor and write into your file and save it. hello.txt Hello Everyone! hello.txt ✔ Display the Content of a File ➡ : cat We can display the content of a file using the command. To use it type . cat cat file_name Shows the content of my file. hello.txt ✔ Moving Files & Directories ➡ : mv To move a file and directory, we use command. mv By typing , you can move a file to the specified directory. mv file_to_move destination_directory By entering , you can move all the files and directories under that directory. mv directory_to_move destination_directory Before using this command, we are going to create two more directories and another file in our directory. txt cli-practice mkdir html css touch bye.txt Yes, we can use multiple directories & files names one after another to create multiple directories & files in one command. Move my file into my directory and then move my directory into my directory. bye.txt css css html ✔ Renaming Files & Directories ➡ : mv command can also be used to rename a file and a directory. mv You can rename a file by typing & also rename a directory by typing . mv old_file_name new_file_name mv old_directory_name new_directory_name Rename my file to the file and directory to the directory. hello.txt hi.txt html folder ✔ Copying Files & Directories ➡ : cp To do this, we use the command. cp • You can copy a file by entering . cp file_to_copy new_file_name Copy my file content into file. For confirmation open your file in your text editor. hi.txt hello.txt hello.txt • You can also copy a directory by adding the option, like . -r cp -r directory_to_copy new_directory_name The -r option for "recursive" means that it will copy all of the files including the files inside of subfolders. Here I copy all of the files from the to . folder folder-copy ✔ Removing Files & Directories ➡ : rm To do this, we use the command. rm • To remove a file, you can use the command like . rm file_to_remove Here I remove my file. hi.txt • To remove a directory, use the command like . rm -r directory_to_remove I remove my directory from my directory i.e. current working directory. folder-copy cli-practice ✔ Clear Screen ➡ : clear Clear command is used to clear the terminal screen. ✔ Home Directory ➡ : ~ The Home directory is represented by . The Home directory refers to the base directory for the user. If we want to move to the Home directory we can use command. Or we can only use command. ~ cd ~ cd 🛠 Tools I used for this tutorial:- Fluent Terminal Git Bash Shell Thanks for reading and stay tuned.🙂👋 Previously published at https://dev.to/iamismile/command-line-tutorial-58km Please Visit My Website