Friday, August 21, 2015

Linux useful commands and informations

1. In debian based OS apt-get install command will download the .deb package in the below folder before installation.

    /var/cache/apt/archives/

2. To format disk in commandline

      sudo cfdisk /dev/sdb

   One another option is

     sudo mkfs.ext4 /dev/sdb1

3. Find User ID (uid) of the current user in Linux system.

      id -u [USER_NAME]

      eg:  id -u root  (which will be 0).

4. Change ownership of a folder for specific user.

      chown -R [UID_OF_USER] [PATH_TO _FOLDER]

      eg: chown -R 1000 /opt/tinyos-2.x/

5. Find a file or directory in specific place.

      find [PATH_TO_SEARCH] -name [FILE_NAME]

      eg: find /opt -name tinyos.sh

6. Install grub due to some error in grub.

      grub-install --root-directory=/dev/sda

7. Write OS image (*.img) into USB/ microSD in linux (Ubuntu).
     Create bootable USB/ microSD from image file (.img)

      sudo dd if=./BBB*.img of=/dev/sdX

      sdX, here X denote where the device is mounted.

8. SSh connection failure due to the error "Host key verification failed."

     ssh-keygen -R



9. Find baud rate of a serial device through commanline

    sudo stty -F /dev/ttyUSB0    //replace ttyUSB0

No comments:

Post a Comment