Linux


linux commands.


rm -rf  <File Name>                 -------------- meaning of rf : remove the file forcefully.
pwd                    --------------- present working directory.
ls -lrt                    --------------- list all the files and folders with permissions.
cp   <file1>    <file2>             ---------------- cp command is used for the back up of file.
convention of backup of file1 rename  as file2: we append at the end of file name1.
"ddmmyear_person"
this is duplication of the file1 as file2.
mv file  <dir> ...............> it just moves the file to the specified directory.
Root
this is root level modification only adminstrator is doing these modifications.
this cant be done by a service account user.
so for that we use
su command.
su  -  .................meaning is switch user.
this goes to the root level user for that we need to enter the admin password.
after that we can get back to service account with the following command.
su - sv-wl10
here sv-wl10 is service account.here switched to sv-wl10 service account.
what is vi ?
it is an editor to create or modify the existing file content , save the file.
for example
vi etc/hosts
vi etc/sysconfig/network
both of these should perform in the root account or admin account.
we only able to see the content and cant modify through service account since only admin have the permissions both read , write.
cd .....................>this is the home directory.
cd   /home/sv-wl10.          ..............>this is the dirctory change.
chown    service account  (sv-wl10):group account (sv-wl10)    <file> :    This means we are changing the ownership to service account.
change the directory to change mod then execute the chmod .
chmod  -R  755  *    ........>This is to change file or permissions here 755 is to change the folder/file .
permissions:
Read,write,execution. here read.........> [r] means 4 , write.....> [w] means 2 , execute means 1[x]
there is ---read write execute this is the order for permissions of files and folders.
ps -ef | grep java  ...............>it will display the processes that are running on the java.
ps -ef | grep http  ..............>it will display all the processes that are running apache.
ps -ef | grep tomcat  .............> it iwll display all the processes that are running tomcat on the server.
top .......................................> it displays all the processes running on the server along with cpu and memory consumption and also it displays load averages.
top  -b  5   ...................................> it displays the top 5 processes consuming memory and cpu.
free -m       ...................................> it displays the memory statistics
(total alloted memory, used memory , availble memory ,cache - buffer , swap memory allocated and the usage)
mkdir   <folder>...............> make directory
torch   <file>...................>to create file.
vi  <fileName> ...............>to edit the file.
cat  <fileName> .............>to view the file.
cat >file .................to create the file and open file.
cat >>file ................>to append the file (new lines can be added to the existing file).
man <command> ................>example command is "cp".
more <file> ...............>displays the first page of the file .
head  <file> displays the few lines of the file.
tail -f <file>  it displays the few lines
tail -500f <file> ............> displays the last 500 lines.
nslookup  <dns>  .............>to check the dns or ipaddress.
hostname .............> it displays the hostname of the server.
hostname  -9
hostname  -f
netstat -an | grep <port no>
ctrl +u ...........>it removes the current command on the same line.
diff  - file1 file2.............>it shows the difference of the content between the file1 and file2.
exit ...........>it just exit from the session or account where ever we switch.
id    ..........> it displays the curent user logged in.

Last login: Tue Jan 22 21:29:13 2019 from 192.168.253.1
[bala@inddlvtwlmas01 ~]$ cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 61
model name      : Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz
stepping        : 4
microcode       : 0x1d
cpu MHz         : 2194.917
cache size      : 3072 KB
physical id     : 0
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 20
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch epb fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap xsaveopt dtherm ida arat pln pts
bogomips        : 4389.83
clflush size    : 64
cache_alignment : 64
address sizes   : 42 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 61
model name      : Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz
stepping        : 4
microcode       : 0x1d
cpu MHz         : 2194.917
cache size      : 3072 KB
physical id     : 2
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 2
initial apicid  : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 20
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch epb fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap xsaveopt dtherm ida arat pln pts
bogomips        : 4389.83
clflush size    : 64
cache_alignment : 64
address sizes   : 42 bits physical, 48 bits virtual
power management:

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 61
model name      : Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz
stepping        : 4
microcode       : 0x1d
cpu MHz         : 2194.917
cache size      : 3072 KB
physical id     : 4
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 4
initial apicid  : 4
fpu             : yes
fpu_exception   : yes
cpuid level     : 20
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch epb fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap xsaveopt dtherm ida arat pln pts
bogomips        : 4389.83
clflush size    : 64
cache_alignment : 64
address sizes   : 42 bits physical, 48 bits virtual
power management:

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 61
model name      : Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz
stepping        : 4
microcode       : 0x1d
cpu MHz         : 2194.917
cache size      : 3072 KB
physical id     : 6
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 6
initial apicid  : 6
fpu             : yes
fpu_exception   : yes
cpuid level     : 20
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology tsc_reliable nonstop_tsc aperfmperf eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch epb fsgsbase tsc_adjust bmi1 avx2 smep bmi2 invpcid rdseed adx smap xsaveopt dtherm ida arat pln pts
bogomips        : 4389.83
clflush size    : 64
cache_alignment : 64
address sizes   : 42 bits physical, 48 bits virtual
power management:

[bala@inddlvtwlmas01 ~]$ cat /proc/meminfo
MemTotal:        3861512 kB
MemFree:         1014560 kB
MemAvailable:    1820664 kB
Buffers:            2084 kB
Cached:          1033256 kB
SwapCached:            0 kB
Active:          1744024 kB
Inactive:         794124 kB
Active(anon):    1504080 kB
Inactive(anon):    50068 kB
Active(file):     239944 kB
Inactive(file):   744056 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       4064252 kB
SwapFree:        4064252 kB
Dirty:                40 kB
Writeback:             0 kB
AnonPages:       1502848 kB
Mapped:           213524 kB
Shmem:             51340 kB
Slab:             112388 kB
SReclaimable:      53392 kB
SUnreclaim:        58996 kB
KernelStack:       11328 kB
PageTables:        42220 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     5995008 kB
Committed_AS:    5911580 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      220460 kB
VmallocChunk:   34359277564 kB
HardwareCorrupted:     0 kB
AnonHugePages:    808960 kB
CmaTotal:              0 kB
CmaFree:               0 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:      145216 kB
DirectMap2M:     3000320 kB
DirectMap1G:     3145728 kB
[bala@inddlvtwlmas01 ~]$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3771        1666         983          50        1120        1770
Swap:          3968           0        3968
[bala@inddlvtwlmas01 ~]$ df -kh
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        56G  6.9G   49G  13% /
devtmpfs        1.9G     0  1.9G   0% /dev
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           1.9G   13M  1.9G   1% /run
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/sda1       297M  206M   92M  70% /boot
tmpfs           378M  4.0K  378M   1% /run/user/42
tmpfs           378M   32K  378M   1% /run/user/1000
[bala@inddlvtwlmas01 ~]$ du -sh
.bash_history      ca.key             .gnome/            oraInventory/
.bash_logout       .config/           .ICEauthority      Pictures/
.bash_profile      .dbus/             .java/             .pki/
.bashrc            Desktop/           .local/            Public/
.cache/            Documents/         .mozilla/          Templates/
ca.crt             Downloads/         Music/             Videos/
ca.csr             .esd_auth          .oracle_jre_usage/ .viminfo
[bala@inddlvtwlmas01 ~]$ du -sh ca.key
4.0K    ca.key
[bala@inddlvtwlmas01 ~]$ du -s ca.key
4       ca.key
[bala@inddlvtwlmas01 ~]$ du -mh ca.key
4.0K    ca.key
[bala@inddlvtwlmas01 ~]$ du -gh ca.key
du: invalid option -- 'g'
Try 'du --help' for more information.
[bala@inddlvtwlmas01 ~]$ netstat -an | grep 7001
tcp6       0      0 192.168.122.1:7001      :::*                    LISTEN
tcp6       0      0 ::1:7001                :::*                    LISTEN
tcp6       0      0 192.168.253.130:7001    :::*                    LISTEN
tcp6       0      0 127.0.0.1:7001          :::*                    LISTEN
[bala@inddlvtwlmas01 ~]$ ping 192.168.253.130
PING 192.168.253.130 (192.168.253.130) 56(84) bytes of data.
64 bytes from 192.168.253.130: icmp_seq=1 ttl=64 time=0.051 ms
64 bytes from 192.168.253.130: icmp_seq=2 ttl=64 time=0.054 ms
64 bytes from 192.168.253.130: icmp_seq=3 ttl=64 time=0.044 ms
64 bytes from 192.168.253.130: icmp_seq=4 ttl=64 time=0.070 ms
64 bytes from 192.168.253.130: icmp_seq=5 ttl=64 time=0.065 ms
64 bytes from 192.168.253.130: icmp_seq=6 ttl=64 time=0.046 ms
64 bytes from 192.168.253.130: icmp_seq=7 ttl=64 time=0.049 ms
64 bytes from 192.168.253.130: icmp_seq=8 ttl=64 time=0.044 ms
64 bytes from 192.168.253.130: icmp_seq=9 ttl=64 time=0.050 ms
64 bytes from 192.168.253.130: icmp_seq=10 ttl=64 time=0.054 ms
64 bytes from 192.168.253.130: icmp_seq=11 ttl=64 time=0.048 ms
64 bytes from 192.168.253.130: icmp_seq=12 ttl=64 time=0.046 ms
64 bytes from 192.168.253.130: icmp_seq=13 ttl=64 time=0.050 ms
64 bytes from 192.168.253.130: icmp_seq=14 ttl=64 time=0.045 ms
64 bytes from 192.168.253.130: icmp_seq=15 ttl=64 time=0.063 ms
64 bytes from 192.168.253.130: icmp_seq=16 ttl=64 time=0.061 ms
64 bytes from 192.168.253.130: icmp_seq=17 ttl=64 time=0.057 ms
64 bytes from 192.168.253.130: icmp_seq=18 ttl=64 time=0.066 ms
64 bytes from 192.168.253.130: icmp_seq=19 ttl=64 time=0.062 ms
64 bytes from 192.168.253.130: icmp_seq=20 ttl=64 time=0.063 ms
^C
--- 192.168.253.130 ping statistics ---
20 packets transmitted, 20 received, 0% packet loss, time 19031ms
rtt min/avg/max/mdev = 0.044/0.054/0.070/0.010 ms

Comments

Popular posts from this blog

Bsu

linux

Domain