Hi everyone in this Ros tutorial we look at the most commonly used ros linux commands. If we want to use the Ros effectively, we need to know these commands. So let look at close what is these commands.
It shows us the file path of the working directory.
“mkdir” command creates a folder on the working directory.
“mkdir -p” command creates nested folders on the working directory.
mkdir -p folder2/folder3
This command creates any file that has a specific extension.
touch file2.py touch file2.cpp
The cat command opens any file on the terminal.
The “ls” command lists all files and folders into the working directory.
The “ls” command lists all hidden files and folders into the working directory.
The “History” command lists all previously used commands.
The “sudo su” command makes the user a superuser for all operations.
The “sudo” command makes the user a superuser for only one operation.
sudo apt-get install python3
The “clear” command clears the terminal screen.
The “man ls” command gives pieces of information about the commands.
sudo apt-get remove
This command uninstall the specified package.
sudo apt-get remove nano
sudo apt-get install
This command install the specified package.
sudo apt-get install nano
The nano command is a text editor that works on the terminal. We can open, edit, and save any file with this nano editor.
The “cp” command copies that we specified file into a specific folder.
cp file1.py folder1
The “cp -r” command copies that we specified folder into another folder.
cp -r folder1 folder2
The “mv” command moves any file or folder into another folder. Also, we can use the move command to rename files or folders.
for move move file.py folder2 for rename move file.py file2.py
This command removes any file on the working directory.
This command remove any folder on the working directory.
rm -rf folder1
This “ls -l” command shows us the authorizations of each file in the working directory. If we look at the following image, our file.py file has only read and write right. If we want to give the execute right to the file.py file, we can use the chmod +x file.py command like the following code.
chmod +x file.py