The CLI (Command Line Interface) is a text-based interface used to interact with a computer's operating system or software applications. Here are some commonly used CLI commands:
-
cd- Change directory: This command is used to navigate between directories. For example,cd Documentswill take you to the Documents directory. -
ls- List files: This command lists the files and directories in the current directory. -
mkdir- Make directory: This command creates a new directory. For example,mkdir my_foldercreates a new folder called "my_folder". -
rm- Remove: This command is used to delete files or directories. For example,rm file.txtwill delete the file named "file.txt". -
cp- Copy: This command copies files or directories. For example,cp file.txt ~/Documentswill copy the file "file.txt" to the Documents directory. -
mv- Move: This command moves files or directories. For example,mv file.txt ~/Documentswill move the file "file.txt" to the Documents directory. -
pwd- Print working directory: This command displays the current directory. -
cat- Concatenate: This command displays the contents of a file. For example,cat file.txtwill display the contents of the file "file.txt". -
grep- Global regular expression print: This command searches for a specific string of text in a file. For example,grep "hello" file.txtwill search for the word "hello" in the file "file.txt".
These are just a few examples of commonly used CLI commands. There are many more commands available depending on the operating system and software being used.