- pwd — When you first open the terminal, you are in the home directory of your user. To know which directory you are in, you can use the “pwd” command. It gives us the absolute path, which means the path that starts from the root. The root is the base of the Linux file system and is denoted by a forward slash( / ). The user directory is usually something like “/home/username”.
- ls — Use the “ls” command to know what files are in the directory you are in. You can see all the hidden files by using the command “ls -a”.
- cd — Use the “cd” command to go to a directory. “cd” expects directory name or path of new directory as input.
- mkdir & rmdir — Use the mkdir command when you need to create a folder or a directory.Use rmdir to delete a directory. But rmdir can only be used to delete an empty directory. To delete a directory containing files, use rm.
- rm – Use the rm command to delete a file. Use “rm -r” to recursively delete all files within a specific directory.
- touch — The touch command is used to create an empty file. For example, “touch new.txt”.
- cp — Use the cp command to copy files through the command line.
- mv — Use the mv command to move files through the command line. We can also use the mv command to rename a file.
9.cat — Use the cat command to display the contents of a file. It is usually used to easily view programs.
10.vi - You can create a new file or modify a file using this editor.
Top comments (0)