Monday, May 22, 2023

How to download file using wget and curl command in linux ?

Download file using wget and curl command in linux 




[root@0.0.0.0 ~]# rpm -qa | grep -i wget

wget-1.19.5-11.el8.x86_64

[root@0.0.0.0 ~]#


Using wget commnad :


[root@0.0.0.0 ~]#

[root@0.0.0.0 ~]# wget https://the.earth.li/~sgtatham/putty/latest/putty-0.78.tar.gz

--2023-05-22 15:44:09--  https://the.earth.li/~sgtatham/putty/latest/putty-0.78.tar.gz

Resolving the.earth.li (the.earth.li)... 93.93.131.124, 2a00:1098:86:4d:c0ff:ee:15:900d

Connecting to the.earth.li (the.earth.li)|93.93.131.124|:443... connected.

HTTP request sent, awaiting response... 302 Found

Location: https://the.earth.li/~sgtatham/putty/0.78/putty-0.78.tar.gz [following]

--2023-05-22 15:44:10--  https://the.earth.li/~sgtatham/putty/0.78/putty-0.78.tar.gz

Reusing existing connection to the.earth.li:443.

HTTP request sent, awaiting response... 200 OK

Length: 2811628 (2.7M) [application/x-gzip]

Saving to: ‘putty-0.78.tar.gz’


putty-0.78.tar.gz               100%[=====================================================>]   2.68M  4.71MB/s    in 0.6s


2023-05-22 15:44:10 (4.71 MB/s) - ‘putty-0.78.tar.gz’ saved [2811628/2811628]


[root@0.0.0.0 ~]#



Using curl command :


[root@0.0.0.0 tmp]# curl -O https://the.earth.li/~sgtatham/putty/latest/putty-0.78.tar.gz

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100   306  100   306    0     0   1066      0 --:--:-- --:--:-- --:--:--  1066

[root@0.0.0.0 tmp]#

[root@0.0.0.0 tmp]#


Friday, May 19, 2023

How to check User Shell details ?

 Check User Shell details  :



[root@0.0.0.0]# cat /etc/passwd

root:x:0:0:root:/root:/bin/bash


[root@0.0.0.0]# echo $0

-bash

[root@0.0.0.0]#


How to check available shell in Linux OS ?

 Check available shell in Linux OS : 


[root@0.0.0.0]# cat /etc/shells

/bin/sh

/bin/bash

/usr/bin/sh

/usr/bin/bash

/bin/ksh

/bin/rksh

/usr/bin/ksh

/usr/bin/rksh

[root@0.0.0.0]#

How to know Linux OS is 64 bit or 32 bit ?

 How to know Linux OS is 64 bit or 32 bit  ?


First Method :

[root@0.0.0.0]#

[root@0.0.0.0]# which arch

/usr/bin/arch

[root@0.0.0.0]#

[root@0.0.0.0]#

[root@0.0.0.0]#

[root@0.0.0.0]# arch

x86_64

[root@0.0.0.0]#

[root@0.0.0.0]#

[root@0.0.0.0]#



Second Method :


[root@0.0.0.0]# uname -a

Linux ip-172-31-19-40.ec2.internal 4.18.0-425.19.2.el8_7.x86_64 #1 SMP Fri Mar 17 01:52:38 EDT 2023 x86_64 x86_64 x86_64 GNU/Linux

[root@0.0.0.0]#


This is 64 bit Operating System because of output is x86_64