What does it mean to apply updates from adb. Consistent actions with the team


I found out that this Apply update from ADB is included in the developer toolkit software, being one of the components Android SDK. Using Apply update from ADB, installing necessary drivers, and by switching the device into direct interaction with a computer via a USB interface, you gain complete control over it.

The Apply update from ADB console utility allows you to perform the following operations:

  • Installing and uninstalling any applications, including pre-installed ones;
  • Transfer files to the device and retrieve them;
  • Creating operating system backups;
  • Installation of new, including custom, firmware;
  • Restoring Android if damaged system files.

If you don’t yet know about the existence of a bulk folder on your smartphones, I recommend visiting the corresponding article.

Installation methods Apply update from ADB

There are several ways to use ADB. The easiest and most suitable for most users will be to install the ADBKit package. It contains the utility itself and dynamically linked libraries necessary for its interaction with the Windows operating system. A set is installed separately universal drivers for Android devices. Download necessary files can be found on the ADB Shell project website. The page is in English, but the Commands section contains detailed description management teams.

The Apply update from ADB utility is a console application, so you use the Windows command line to work with it. The recommended installation location for the Android Debug Bridge package is the root directory. The folder into which ADBKit is unpacked should not contain Cyrillic characters. All these recommendations ultimately simplify the user's work on the command line, minimizing possible errors when entering control commands by shortening the path to files.

To work in console mode, an Android device must be switched to “USB debugging” mode. After connecting the cable to the computer, select the “Charging only” option. This way you prepare the device to interact with the computer. I hope you understand what Apply update from ADB is. The sequence of the described actions is well shown in this video.

In it you will learn how to install and run the utility in command console Windows OS. Additionally, it provides the syntax main commands required when flashing the device. How the Apply update from ADB c utility works Android smartphone, after switching to the console interaction mode, are clearly shown in the following material.

For more advanced users, we can recommend installing a set of Software Development Kit intended for Android developers. The SDK receives regular updates necessary to create applications that support new devices. Thanks to this, a set of drivers for your Android devices will always be kept up to date. Download Development Toolkit Kit is better with just official page, at the same time, without confusing it with full set Android Studio utilities.

Finally

What is Apply update from ADB? A variety of device models running Android OS, modified Linux versions, does not allow us to provide universal recommendations for setting them up. This material is intended to point in the right direction of search and provide the basics of use Android toolkit Debug Bridge. Using these recommendations, you can connect any mobile device and perform actions with it that are not available through official utilities manufacturers.

In contact with

Many of you have more than once encountered a situation where, in order to receive root rights on Android tablet or smartphone, installing new firmware, system recovery and other things, you had to connect it to the computer and execute a series of adb or fastboot commands through the window command line(terminal).

Most people enter these commands without understanding what they mean, simply following instructions found on the Internet. And if you want to get a better understanding of what happens when you execute them, today we'll take a look at the top ten commands that every advanced Android user should know.

But before you start getting acquainted with these commands, let me remind you that before your tablet or smartphone can execute them, you must make sure that your computer has Android SDK, and on the tablet or smartphone itself, the option “ USB Debugging ».

How to install the Android SDK, which contains the adb and fastboot programs, read this material.

Let me also remind you that in Android 4.2 and higher, the “USB Debugging” item is hidden, and you can read how to access it.

For those who have forgotten how to launch a command line window in Windows, let me remind you that the easiest way to do this is by clicking on “Start”, after which you will need to type cmd in the search window and press the “Enter” key.

After everything preparatory work finished, you can connect the device to your computer using USB cable and start learning the commands.

1. adb devices command

This is probably the most important of all ten teams that will be discussed. Using it, we can find out whether the computer sees your Android device, and if it does, then whether it can communicate with it through terminal commands.

If everything is fine, then after entering the adb devices command in a Windows command line window or Linux terminal, you should see a line with the text List of devices attached, after which there will be a line consisting of the serial number of your device and its status - offline or online:

The offline state means that the device is in sleep mode. The online state signals that the tablet or smartphone is ready to carry out your commands.

2. adb push command

Using the adb push command, you can copy files to your tablet or smartphone. In this case, you must specify the path to the folder where you want to place the file on the device and the folder on the computer from where the file will be copied. The second path is not necessary if the file is located in the same folder where the adb program is located.

Here is an example of copying a video file superfreak.mp4 from a computer to a device, to the /sdcard/Movies folder using the adb push superfreak.mp4 /sdcard/Movies/ command

For Windows users I would like to remind you that in Android, when specifying the path to files and folders, a forward slash - / is used, and not a backslash, as you are used to.

3. adb pull command

If adb command push is used to transfer files to an Android device, adb pull is used to copy files from a device to a computer. Just as in the previous case, you must indicate the path where you want to get the file on the device and the path where you want to place this file on the computer. The second path is not necessary if you want the file to go to the folder from which you ran the adb program.

Here is an example of copying the superfreak.mp4 file from the /sdcard/Movies/ folder of your tablet or smartphone to your desktop Windows table 8 user Jerry, C:\Users\Jerry\Desktop

If you want the file to go to the folder you ran adb from, just enter the command adb pull /sdcard/Movies/superfreak.mp4

4. adb reboot command

This command is often used in the process getting root rights or installing new software when we need to accept the changes we have made on our device. After you enter the adb reboot command, your tablet or phone will reboot.

This command is also important because it can be placed inside scripts, which allows you to reboot the device automatically after completing all the necessary operations.

5. adb reboot-bootloader and adb reboot recovery commands

WITH using adb You can not only reboot your Android device, but also reboot it into the bootloader. This mode is needed so that we can unlock the bootloader, which is necessary to obtain root rights and further install alternative firmware.

Some devices can be bootloaded using certain combination keys when they are turned on, but often the adb reboot-bootloader command is the only way access the bootloader.

Similarly, the adb program can be used to access the recovery menu of a tablet or smartphone or recovery. This can be done using the adb reboot recovery command

6. Fastboot devices command

If you rebooted your tablet into bootloader mode, it will stop accepting adb commands. In this mode, we can communicate with the device using the fastboot program.

Using the command fastboot devices you can find out if your device can accept commands from this program in bootloader mode. Since fastboot is very powerful tool, some Android device manufacturers do not provide access to this program in bootloader mode.

Just like with adb, after entering the fastboot devices command you should see serial number your device.

Often the reason fastboot does not work is the lack of necessary Windows drivers your device.

7. Fastboot oem unlock command

Some manufacturers (for example, HTC or Asus) produce special utilities, allowing you to unlock the bootloader of their tablets and smartphones, after which they can install alternative recovery, such as ClockworkMod or TWRP and firmware from independent developers (custom firmware).

However, in many cases, unlock Android bootloader devices using the fastboot program. This is very easy to do - when your tablet or phone is in bootloader mode (step 5), just enter in the command line window next command: fastboot oem unlock.

After this, you will need to follow the instructions that will be displayed on the screen of your tablet or smartphone.

Attention! After executing the fastboot oem unlock command, your device will be completely cleared of any programs you have installed and your personal data will also be deleted.

8. adb shell command

Team adb shell often confuses some novice users.

There are two ways to use this command. If you simply enter the text adb shell in the command line window and press the Enter key, you will be taken to terminal mode, or the command shell of your Android device, where you can execute any commands Android shell.

Below you can see the result of running ls command in Android shell

This mode is well known Linux users And Mac computers. If you are familiar with bash shell commands, you will have no problems working in this mode. Otherwise, I do not recommend using adb shell mode until you understand the purpose of all its commands, since in this mode you have full access to files on your device and may accidentally cause irreparable changes to the operating system.

The second way to use adb shell is to execute a single Android shell command using this construct: adb shell<команда>. For example, you can change file permissions using a command like “adb shell chmod 666 /data/filename”

9. adb install command

With the adb program, you can do more than just copy files to and from your device. This program also allows you to install applications on Android devices in the form apk file ov. There is an adb install command for this. It's a bit like the push command: you have to specify the path where the file with the application you want to install is located. Therefore, the easiest way is to first copy the apk file to the folder with adb program, after which you can install the program using the command adb install ApplicationFileName.apk

If you need to update the application, then in this case you need to use the -r switch and the command will look like this: adb install -r ApplicationFileName.apk.

Using the -s switch you can install applications on the memory card (if your firmware allows this). The -l switch allows you to lock the application during installation (by installing it in the /data/app-private folder). There are other keys for more advanced functions, but their description is the topic of a separate article.

10. adb uninstall command

Lastly, you can remove apps from your tablet or phone. To do this, use the command adb uninstall ApplicationFileName.apk

This command has the -k switch, which allows you, when deleting an application, not to delete its data and cache, but to leave them on the device.

Bonus: adb sideload command

This command will be very useful for owners of Nexus tablets and smartphones - with the help of it they will be able to update official firmware on your devices. In other words, if your smartphone or tablet has not received an update over the air, you can download new firmware from the official website, and update the device manually.

After you download the firmware file to your computer and connect your tablet or phone to it, you will need to reboot your device into recovery mode, select "Apply update from ADB", and then enter the following command in the command line window on your computer: adb sideload xxxxxxxx.zip, where xxxxxxxx.zip is the name zip file with firmware.

More detailed instructions You will find information on how to update the firmware of Nexus devices manually in this material.

Related materials:

Majority Android users don't know anything about ADB. The full name is Android Debug Bridge, which stands for “Android Debugging Bridge”. ADB is part of the Android SDK. Using ADB you can perform various actions over your Android tablet or smartphone, such as: flashing, copying files from your computer to Android and back, system recovery and others.

ADB for Android - what is it?

You probably know that the operating room Android system based on a modified Linux kernel. Therefore, there is a need to use the command line with it. It is the adb program that helps establish communication between the computer and Android. She is part of the environment Android development SDK, so to install Android Debug Bridge you need to download Android SDK from official website. There are versions for all popular ones operating systems: Windows, Mac OS and Linux. That is, simply put, adb allows you to control your phone or tablet using a computer.

Connect your device to your PC via USB. Make sure all drivers are installed and USB debugging is enabled.

The best way to work with Android Debug Bridge is through the Windows command line. To do this, in Windows XP, click " Start" and in the input field " Find programs and files" enter " cmd", then click " Enter" If you have Windows 7 or higher, click " Start" and in the field " Execute" enter " cmd" and press the " key again Enter».

  • How to Open Command Prompt in Windows 8
  • How to Open Command Prompt in Windows 10

adb devices

The most common adb command. Using it, you can determine whether your PC sees the connected device. If you did everything correctly, the following line will appear: “ List of devices attached" After it you will see the serial number of your smartphone or tablet and its status: “ online" or " offline».

If it says “offline”, this means that the device is in sleep mode, if “online”, then the device is ready to execute your commands.

Thanks to this command you can install applications on your smartphone or tablet. To do this, you need to specify the path where the APK file is located:

adb intsall D:\papka_s_faylom\nazvanie_prilogeniya.apk

To avoid writing long paths, copy the file to the android-tools directory. Then the path will be like this:

adb intsall nazvanie_prilogeniya.apk

adb uninstall

You need to enter it in the same way as the previous command. This will remove the application.

This team has an interesting feature. If you add the key -k, then when you delete a game or program, its data and cache will not be deleted, but will remain on the Android device.

Thanks to this command, you can transfer files from your computer to Android. To do this, you need to know the full path where the file is stored and where to move it.

adb push D:\papka_s_faylom\nazvanie_fayla/sdcard/Android

To avoid writing long paths, copy the file to the android-tools directory. Then you need to enter:

adb push nazvanie_fayla/sdcard/Android

This command copies files from Android to computer. You need to know the path where the file is located on your smartphone or tablet and indicate the location where you want to save the file. If you do not specify the latter, the file will be saved in the android-tools directory.

adb pull /sdcard/nazvanie_fayla\D:\papka_gde_sohranity

This command will reboot your Android phone or tablet.

With this command you can directly boot into bootloader mode.

adb reboot recovery

Not all devices support this command. Using it you can get into recovery mode.

adb connect

Using this command you can connect your device to a Wi-Fi network. To do this, you need to know the IP address and port of the device.

adb connect ip:port

With this command you get full access to all files on your device.

The second way to use adb shell is to execute a single Android shell command using this construct:

adb shell<команда>

If you put your Android phone or tablet into bootloader mode, the adb commands will no longer work. Here you need to use fastboot commands.

To check whether PC and Android can see each other, use the command:

After entering it, the serial number of your device should appear.

By entering this command, you can unlock the bootloader of your phones and Asus tablets and HTC. When your device is in bootloader mode, enter:

Also all yours installed programs and personal data will be lost.

Using this command you can display the contents log file: changes, errors, etc. The data will scroll too quickly, so the right solution would be to save it in one TXT file. To do this, enter:

adb logcat > filename.txt

adb sideload

The command will be useful for owners of devices of the line Google Nexus. Using it you can update the firmware of the device. Download it to your computer, connect your Nexus to it, go to Recovery mode, select " Apply update from ADB" and then enter the command:

adb sideload name.zip

name.zip– this is the name of the zip file with the firmware.

adb backup and adb restore

Team adb backup creates a backup and adb restore restores from backup.



Many of you have more than once encountered a situation where, in order to obtain root rights on an Android tablet or smartphone, install new firmware, restore the system and other things, you had to connect it to the computer and execute a series of adb or fastboot commands through the command line window (terminal ).

Most people enter these commands without understanding what they mean, simply following instructions found on the Internet. And if you want to get a better understanding of what happens when you execute them, today we'll take a look at the top ten commands that every advanced Android user should know.

But before you start getting acquainted with these commands, let me remind you that before your tablet or smartphone can execute them, you must make sure that your computer has Android SDK, and on the tablet or smartphone itself, the option “ USB Debugging».

How to install the Android SDK, which contains the adb and fastboot programs, read this material.

Let me also remind you that in Android 4.2 and higher, the “USB Debugging” item is hidden, and you can read how to access it.

For those who have forgotten how to launch a command line window in Windows, let me remind you that the easiest way to do this is by clicking on “Start”, after which you will need to type cmd in the search window and press the “Enter” key.

After all the preparatory work is completed, you can connect the device to the computer with via USB cable and start learning the commands.

1. adb devices command

This is probably the most important of all ten teams that will be discussed. Using it, we can find out whether the computer sees your Android device, and if it does, then whether it can communicate with it through terminal commands.

If everything is fine, then after entering the adb devices command in a Windows command line window or Linux terminal, you should see a line with the text List of devices attached, after which there will be a line consisting of the serial number of your device and its status - offline or online:

The offline state means that the device is in sleep mode. The online state signals that the tablet or smartphone is ready to carry out your commands.

2. adb push command

Using the adb push command, you can copy files to your tablet or smartphone. In this case, you must specify the path to the folder where you want to place the file on the device and the folder on the computer from where the file will be copied. The second path is not necessary if the file is located in the same folder where the adb program is located.

Here is an example of copying a video file superfreak.mp4 from a computer to a device, to the /sdcard/Movies folder using the adb push superfreak.mp4 /sdcard/Movies/ command

For Windows users, I would like to remind you that in Android, when specifying the path to files and folders, a forward slash - / is used, and not a backslash, as you are used to.

3. adb pull command

If the adb push command is used to transfer files to an Android device, then adb pull is used to copy files from the device to the computer. Just as in the previous case, you must indicate the path where you want to get the file on the device and the path where you want to place this file on the computer. The second path is not necessary if you want the file to go to the folder from which you ran the adb program.

Here is an example of copying the superfreak.mp4 file from the /sdcard/Movies/ folder of your tablet or smartphone to the Windows 8 desktop of user Jerry, C:\Users\Jerry\Desktop

If you want the file to go to the folder you ran adb from, just enter the command adb pull /sdcard/Movies/superfreak.mp4

4. adb reboot command

This command is often used during the process of rooting or installing new software, when we need to accept the changes that we have made on our device. After you enter the adb reboot command, your tablet or phone will reboot.

This command is also important because it can be placed inside scripts, which allows you to reboot the device automatically after completing all the necessary operations.

5. adb reboot-bootloader and adb reboot recovery commands

Using adb, you can not only reboot your Android device, but also reboot it into the bootloader. This mode is needed so that we can unlock the bootloader, which is necessary to obtain root rights and further install alternative firmware.

Some devices can be bootloaded using a specific key combination when they are turned on, but often the adb reboot-bootloader command is the only way to access the bootloader.

Similarly, the adb program can be used to access the recovery menu of a tablet or smartphone or recovery. This can be done using the adb reboot recovery command

6. Fastboot devices command

If you rebooted your tablet into bootloader mode, it will stop accepting adb commands. In this mode, we can communicate with the device using the fastboot program.

Using the fastboot devices command, you can find out if your device can accept commands from this program in bootloader mode. Since fastboot is a very powerful tool, some Android device manufacturers do not provide access to this program in bootloader mode.

Just like with adb, after entering the fastboot devices command you should see the serial number of your device.

Often the reason fastboot does not work is the lack of necessary Windows drivers for your device.

7. Fastboot oem unlock command

Some manufacturers (for example, HTC or Asus) release special utilities that allow you to unlock the bootloader of their tablets and smartphones, after which you can install alternative recoveries, such as ClockworkMod. or TWRP and firmware from independent developers (custom firmware).

However, in many cases, you can unlock the bootloader of an Android device using the fastboot program. This is very easy to do - when your tablet or phone is in bootloader mode (step 5), just enter the following command in the command line window: fastboot oem unlock.

After this, you will need to follow the instructions that will be displayed on the screen of your tablet or smartphone.

Attention! After executing the fastboot oem unlock command, your device will be completely cleared of any programs you have installed and your personal data will also be deleted.

8. adb shell command

The adb shell command often confuses some novice users.

There are two ways to use this command. If you simply type adb shell in the command line window and press the Enter key, you will be taken to terminal mode, or the command shell of your Android device, where you can execute any Android shell commands.

Below you can see the result of running ls command in Android shell

This mode is well known to Linux and Mac computer users. If you are familiar with bash shell commands, you will have no problems working in this mode. Otherwise, I do not recommend using the adb shell mode until you understand the purpose of all its commands, since in this mode you have full access to the files on your device and can accidentally cause irreparable changes to the operating system.

The second way to use adb shell is to execute a single Android shell command using this construct: adb shell<команда>. For example, you can change file permissions using a command like “adb shell chmod 666 /data/filename”

9. adb install command

With the adb program, you can do more than just copy files to and from your device. This program also allows you to install applications on Android devices in the form of apk files. There is an adb install command for this. It's a bit like the push command: you have to specify the path where the file with the application you want to install is located. Therefore, the easiest way is to first copy the apk file to the folder with the adb program, after which you can install the program using the command adb install ApplicationFileName.apk

If you need to update the application, then in this case you need to use the -r switch and the command will look like this: adb install -r ApplicationFileName.apk.

Using the -s switch you can install applications on the memory card (if your firmware allows this). The -l switch allows you to lock the application during installation (by installing it in the /data/app-private folder). There are other keys for more advanced functions, but their description is the topic of a separate article.

10. adb uninstall command

Lastly, you can remove apps from your tablet or phone. To do this, use the command adb uninstall ApplicationFileName.apk

This command has the -k switch, which allows you, when deleting an application, not to delete its data and cache, but to leave them on the device.

Bonus: adb sideload command

This command will be very useful to owners of Nexus tablets and smartphones - with its help they will be able to update the official firmware on their devices. In other words, if your smartphone or tablet has not received an update over the air, you can download new firmware from the official website and update the device manually.

After you download the firmware file to your computer and connect your tablet or phone to it, you will need to reboot your device into recovery mode, select "Apply update from ADB", and then enter the following command in the command line window on your computer: adb sideload xxxxxxxx.zip, where xxxxxxxx.zip is the name of the zip file with the firmware.

You will find more detailed instructions on how to manually update the firmware of Nexus devices in this material.

Related materials:

What is ADB? Adb commands for Android. In this article you will learn what ADB is, why users need it, and how to manage it using commands in Android terminal. Well, let's start learning adb android commands

Getting to know ADB

ADB (android debug bridge) is a debugging tool, identifying errors in applications, unlocking devices on Android OS and much more. Official documentation for English language you can read on this site.

Download ADB

You can download ADB with the official supplied Android SDK development environment or download small ADB installer, Installation occurs in the root of the disk WITH:\

Make sure that drivers are installed on your PC and USB debugging is enabled on Android.

Adb commands android and linux

Adb commands can be divided into 3 types, directly for Adb command, FastBoot() and Android command.

Adb commands

1. Check if Android is connected, checks whether the PC “sees” your smartphone or tablet.

To make sure that everything works fine and the computer recognizes Android, you need to enter the adb command:

adb devices

This screenshot shows that Android is connected

If you have didn't show up If there is a similar message, then you may need to check the availability of drivers on the PC, the integrity of the cable, and the functionality of the USB port.

2. Android connection via WI-FI

To connect Android via WI-FI networks you need to get the IP address and port of the device, the ADB Wireless application will help you with this (Root required)

after that enter the command:

adb connect ip:port

For example like this:

adb connect 192.168.0.14:5555

Learn more about how to connect Android via WI-FI - USB Debugging.

3. Installing applications on Android

In order to install any application from a computer to Android, you need to enter the command:

adb install

How to use and example:

In order to use the Adb command, you need to install the application. Write:

adb intsall C:papka_gde_y_vas_hranitsya_prilogenieimja_priloginija.apk

That is, write the command adb install path to the application and the name of this application.

4. Send any file to Android

adb push

How to use and example

In order to send a file from PC to Android using the Adb command. Write:

adb push C:papka_gde_hranitsya_fileimja_file /sdcard

That is, write adb command path to file, file name and location where to save this file.

5. Receive a file from Android to PC

In order to accept absolutely any file with Android devices There is a command on the computer:

adb pull

How to use and example:

In order to receive a file from Android to PC using the Adb command, you need to. Write:

adb pull /sdcard/xxx/Sex_s_Pameloy_Anderson C:papka_gde_budet_hranitsya_file

That is, write the adb command path to the file located on Android, the name of the file and the place where to save this file on the PC.

In order to reboot Android after any operations performed, or reboot into a special mode, there is a command:

adb reboot

Usage example:

The commands will reboot Android

adb reboot adb reboot normal

Bootloader

adb reboot bootloader

The command will reboot Android into Recovery mode

adb reboot recovery

7. Go to Android management, after which you can use Android OS commands

The full potential of Android is revealed when you go into Android management where many Linux commands are available. There is a command for this:

adb shell

Commands in the Android terminal

Superuser or Root. Allows you to perform absolutely all actions, from creating, modifying, changing, to deleting specific system files: To do this, enter the command:

su

Before entering the command

su

the user is a Guest in the system (many actions are blocked) and is indicated at the beginning of the terminal with a dollar sign

$

after entering the command

su

becomes an Administrator and is designated in the terminal as an American number

#

and a live example:

2. Command to go to a folder (in the future it will be more correct to call a directory instead of a folder)

In order to navigate between partitions and directories in Android, there is special team:

CD

Example to move from the /sdcard section to the /sdcard/xxx/porno/hot_girl section

cd /sdcard xxx/porno/hot_girl

In order to return from a partition to the directory above or back to /sdcard
if we are in the directory /sdcard/xxx/porno/hot_girl - hot_girl

CD..

we'll be in the catalog

/sdcard/xxx/porno/

if you need to go to /sdcard then

cd ../ ../ (as many times as necessary) Attention in Android and others Unix systems Primer and primer or PrimER files are completely different files

3. Move/Rename file or directory.

Moving and renaming a file or directory is carried out with only one command:

mv

Example Rename file

mv /sdcard/xxx/hot_porno/Alenka.avi /sdcard/xxx/hot_porno/kruto.avi

Example Rename a folder:

mv -r /sdcard/xxx/hot_porno /sdcard/xxx/super

Example how to Move a file:

mv /sdcard/xxx/hot_porno/Alenka.avi /sdcard/xxx/Alenka.avi

Example of how to Move a folder:

mv -r /sdcard/xxx/hot_porno /sdcard/hot_porno

4. View what is inside the catalog

In order to find out what directories and files are contained from the location where you are, use the following Linux command:

ls

Usage example:

ls /sdcard/xxx/hot_porno/

will display a message

Alenka.avi Pamela.avi Anderson.avi ls -a ls -a /sdcard/xxx/hot_porno/

will display the following message:

Alenka.avi Pamela Anderson.avi .Skrutiy_File.avi

5. Copy a file or folder (directory).

In order to copy a file or folder and move it somewhere:

cp

Example Copy file:

cp /sdcard/xxx/hot_porno/Alenka.avi /sdcard/xxx/Alenka.avi

Example Copy folder:

cp -r /sdcard/xxx/hot_porno /sdcard/hot_porno

6. Connect the section (prime) and disconnect.

In order to find out what partitions exist in Android, connect or disconnect:

mount(connect section) and umont(detach partition)

Find out which sections are primed in this moment, enter

mount

To attach a section:

mount /dev/block/mmcc121 mount /systcode

To detach a partition:

umount /dev/block/mmcc121 umount /systcode

7. Create a directory (folder)

To create a folder somewhere, use the command:

mkdir

Usage example:

mkdir /sdcrad/android_file

8. Delete a directory (folder) or file

If you need to delete any file or linux folder team:

rm

Example of how to delete a file:

rm /sdcard/xxx/hot_porno/Alenka.avi

Example of how to delete a folder:

rm - r /sdcard/xxx/hot_porno

9. Display the contents of the file on the screen (read)

If you are faced with the task of displaying the contents of a text file:

cat cat /sdcard/books/Tolstoy_book_war_and_peace.txt

and we get

- Eh bien, mon prince. Genes et Lucques ne sont plus que des apanages, des estates, de la famille Buonaparte. Non, je vous previens, que si vous ne me dites pas, que nous avons la guerre, si vous vous permettez encore de pallier toutes les infamies, toutes les atrocodes de cet Antichrist (ma parole, j`y crois) - je ne vous connais plus, vous n`etes plus mon ami, vous n`etes plus my faithful slave, comme vous dites.

10. Display the contents of the file on the screen (read in reverse order)

If you are faced with the task of displaying the contents of a text file, but from the end to the beginning:

tac

11. Show full path

In order to understand which section and directory you are in:

pwd

Example: if we are in any directory and need to find out the full path (for example, we are in system partition, app directory)

pwd

will display a message

/system/app/

12. Create an empty file

In order to create text file:

touch

For example, create a file 666.txt in the /sdcrad directory

touch /sdcard/666.txt

13. Creating a backup copy from a partition and restoring

dd if

Example of creating a Backup on an SD card

dd if=dev/block/mmcblk0p1 of=sdcard/efs.img

Example of Partition Recovery from backup copy from SD card

dd if=/sdcard/efs.img of=/dev/block/mmcblk0p1

14. View the space occupied by a file

To understand how long something takes:

du du systcode

Setting permissions for files and directories

To find out what rights files and directories have, you need to write the following command

ls -n

Access rights (permission)

They are written down in this form - RWX (letter) or 777 (digital)

Access rights are shared

1.Access to files
2.Directory access

Literal permissions attributes

r- reading data from files and directories (read)
w- changing the contents of files and directories or writing to them, but not deleting (write)
x- execution of a file or permission to enter a directory

There are three groups of users

« user" - owner of the file or directory
« group» -member of the group to which the owner belongs
« world» - the rest, not belonging to the 2nd groups

The order of recording access rights looks like this
First, access rights are set for the owner - “ u»
after the group - " g»
and at the end for the rest - “ o»

For example

The owner of the file has the right to read (r), write (w) to it and execute (x), others only have the right to read.

Digital permissions attributes

r - read 4
w - entry 2
x - execution 1
"-" no rights 0

The sum of their values ​​means the final rights for the user and groups

7 (rwx) = 4 + 2 +1 full rights
5 (r-x)= 4 + 0 + 1 read and execute
6 (rw-) = 4 + 2 + 0 read and write
4 (r-) =4 + 0 + 0 read only

For beginners, an online calculator may be useful - link.

You need to set permissions with the command

chmod

For example

chmod 777* - will set read, write and execute permissions to all files and folders

chmod 755 file.avi

Hard and symbolic links

In Linux, including Android, there is such a thing as links - which in normal, familiar language sounds like a “shortcut”. There are two types of links:

  • Hard links
  • Symbolic links or symlinks

What are the differences between hard and symbolic links?

Symbolic links - create a shortcut that indicates the exact location of the file or folder where the shortcut links. If you move a file or folder, the symbolic link will be broken. To clearly understand what a symbolic link is, in Windows XP or Windows 7 there are program shortcuts on the desktop that link to the folder with the program, or more precisely, the exe file.

How to create hard and symbolic links

ln ln -s







2024 gtavrl.ru.