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.

pwd

It shows us the file path of the working directory.

mkdir

“mkdir” command creates a folder on the working directory.

mkdir folder1

mkdir -p

“mkdir -p” command creates nested folders on the working directory.

mkdir -p folder2/folder3

touch

This command creates any file that has a specific extension.

touch file2.py  
touch file2.cpp

cat

The cat command opens any file on the terminal.

cat file.py

ls

The “ls” command lists all files and folders into the working directory.

ls -a

The “ls” command lists all hidden files and folders into the working directory.

history

The “History” command lists all previously used commands.

sudo su

The “sudo su” command makes the user a superuser for all operations.

sudo

The “sudo” command makes the user a superuser for only one operation.

sudo apt-get install python3

clear

The “clear” command clears the terminal screen.

man ls

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

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.

nano hello_world.py

cp

The “cp” command copies that we specified file into a specific folder.

cp file1.py folder1

cp -r

The “cp -r” command copies that we specified folder into another folder.

cp -r folder1 folder2

mv

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

rm

This command removes any file on the working directory.

rm file.py

rm -rf

This command remove any folder on the working directory.

rm -rf folder1

ls -l

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
image.png