-
Notifications
You must be signed in to change notification settings - Fork 0
2_Linux_Tips
A collection of useful commands and tips for working with Linux.
To display the directory structure as a tree:
tree -L 2-
-L 2: Limits the depth to 2 levels. -
--prune: Hides empty folders.
To see how much space the current directory is using:
dfThe syntax for mv (move) and cp (copy) is the same. The first argument is the source, and the second is the destination.
# Move a file to the parent directory's "Folder"
mv file.png ../Folder
# Copy a file to the parent directory's "Folder"
cp file.png ../FolderTo open a directory (or file) with the default application:
open ~/ros2_ws/To open the file manager with root privileges (be careful!):
sudo nautilusTo permanently delete a file:
rm filename.txtTo grant a file execute permissions, allowing it to be run as a script:
chmod +x filename.py# Power off the computer
sudo poweroff
# Reboot the computer
sudo rebootTo check system statistics like CPU and memory usage in real-time:
htopTo see what will be cleaned from the APT package cache:
sudo apt-get -s cleanTo perform the cleaning and free up space:
sudo apt-get cleanThe .bashrc file, located in your home directory, contains shell configurations. To edit it:
gedit ~/.bashrcTo search for a previously used command in your terminal history:
Press Ctrl + R and start typing the search term.
The colon (:) is used as a delimiter to concatenate (join) paths in environment variables like PATH.
This example prepends a new directory to the PATH, so the system will look in /opt/ros/indigo/bin first when searching for executables:
export PATH="/opt/ros/indigo/bin:$PATH"Cassini Robotics