There are many command-line utilities available, but some of the most commonly used ones include:
- cd: The 'cd' command is used to change the current working directory. For example, to navigate to the Documents directory, you would enter 'cd' Documents.
- ls: The 'ls' command is used to list the contents of a directory. You can use it to see the files and subdirectories within a directory. For example, to list the contents of the current directory, you would enter 'ls'.
- mkdir: The mkdir command is used to create a new directory. For example, to create a new directory called Project, you would enter mkdir Project.
- pwd: The pwd command is used to display the current working directory. This can be useful if you want to know where you are in the file system.
- cp: The cp command is used to copy a file or directory. For example, to copy a file called file.txt to a new location, you would enter cp file.txt /path/to/new/location.
- mv: The mv command is used to move or rename a file or directory. For example, to rename a file called old_name.txt to new_name.txt, you would enter mv old_name.txt new_name.txt.
- rm: The rm command is used to delete a file or directory. Be careful when using this command, as deleted files cannot be recovered.
- cat: The cat command is used to display the contents of a file. This can be useful if you want to quickly view the contents of a file without opening it in a text editor.
- less: The less command is similar to the cat command, but it allows you to view the contents of a file one page at a time. This can be useful if the file is very large and you don't want to scroll through the entire thing at once.
- grep: The grep command is used to search for a pattern in a file or files. This can be useful if you are trying to find a specific word or phrase in a large text file.
0 Comments