One Day One Cmd

Place for playing with commands…

Monthly Archives: September 2011

Day 100:$ ip addr show

ODOC:About ip addr show command
This command is used to display the ip address details

Example

praveen@praveen-desktop:~$ ip addr show

this command displays like this

1: lo:  mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0:  mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:e0:4c:15:ef:27 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.4/24 brd 192.168.1.255 scope global eth0
    inet6 fe80::2e0:4cff:fe15:ef27/64 scope link 
       valid_lft forever preferred_lft forever

With Regards,
S. Praveen

Advertisements

Day 99:$gpg filename.gpg command (Decrypt)

ODOC:About gpg filename.gpg command

This command is used to Encrypt a file.

Example
Yesterday We learn about encrypt file in my desktop names “aaa.gpg”

Now i wish to decrypt a file

So goto desktop first,
Then type pgp aaa.gpg (filename.gpg)

praveen@praveen-desktop:~/Desktop$ gpg aaa.gpg
Enter passpharse: _
Repeat passpharse: _

please type passpharse that yesterday typed for encrypting.

After putting passpharse, it show’s like this

praveen@praveen-desktop:~/Desktop$ _

That’s all you are successfully Decrypt a file.
Now you can see encrypted file names “aaa” in your desktop

With Regards,
S. Praveen

Day 98:$gpg -c command

ODOC:About gpg -c command

This command is used to Encrypt a file.

Example

I am creating a file names “aaa” in my desktop.
Then I am going to my desktop using cd command.
Then,

praveen@praveen-desktop:~/Desktop$ gpg -c aaa
Enter passpharse: _
Repeat passpharse: _

Now it ask passpharse for the file, Then ask retype passpharse.
After putting passpharse, it show’s like this

praveen@praveen-desktop:~/Desktop$ _

That’s all you are successfully created a Encrypted file.
Now you can see encrypted file names “aaa.gpg” in your desktop

With Regards,
S. Praveen

Day 97: $ fdisk -v

ODOC:About fdisk -v command

Print version number of fdisk program and exit.

Example

praveen@praveen-desktop:~$ sudo fdisk -v
[sudo] password for praveen: _

It will display like this…

fdisk (util-linux-ng 2.17.2)

With Regards,
S. Praveen

Day 96: $ fdisk -l

ODOC: About fdisk -l command

List the partition tables for the specified devices and then exit. If no devices are given, those mentioned in /proc/partitions (if that exists) are used.

Syntaxfdisk [-u] [-b sectorsize] [-C cyls] [-H heads] [-S sects] device

Example

praveen@praveen-desktop:~$ sudo fdisk -l
[sudo] password for praveen: _

It will display like this

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000307ca

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         244     1951744   82  Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sda2             245        9730    76189671+   5  Extended
/dev/sda5            3891        9730    46899200   83  Linux
/dev/sda6             245        3890    29286463+  83  Linux

With Regards,
S. Praveen