قالب وردپرس درنا توس
Home / Tips and Tricks / Important learning commands for your Raspberry Pi projects

Important learning commands for your Raspberry Pi projects



If you find yourself having SSH in your Pi and need to search the file system, some important commands can help you.

To navigate to a specific folder, first use the Change Directory command:

cd ~ / Documents / Screenshots

Unlike Windows, Linux directories start with only one Slash, z. For example, / home / pi / Documents . The tilde (~) is a shortcut that represents your home folder. It can therefore be useful when navigating through user files.

Once you have entered a specific directory, it will be listed in the list next terminal prompt, and you can use the command ls to view the files in this folder:

ls

Or, if you want more details about these files and their view For hidden files, you can execute the command ls with the following flags appended to them:

ls -l -a

To create a new folder in the current directory, you can use mkdir in the following way:

mkdir MyNewFolder

To move or You can use mv and cp to copy files] this way:

mv ~ / Documents / mydoc.txt ~ / Desktop / mydoc.txt

In this example, the ers te path is the current location of the file while the second file path is where you want to move it. To copy a file, simply replace mv with cp .

To delete a file, use the command rm :

rm ~ / Documents / Important / mydoc.txt

You can delete an entire folder and its files delete by adding the -r flag as follows:

rm -r ~ / Documents / Important /

Be especially careful with the rm command because this can not be undone! These commands may seem confusing and esoteric at first glance, but as you use them more and more, they become second nature.


Source link