Linux commands

To display all permissions..of all files on current directory.
>ls -al


clear screen:
>clear

To traverse root to root directory
>cd ../../


to delete the folder recursively.
>rm -R pictures


to delete focibly a filename
>rm -f abc.txt


to copy a file to local current directory
>cp /home/abc/*.* .


to set an environment variable like TOP to ~/BA/SOL/test
>setenv TOP ~/BA/SOL/test


To set an environment variable in bash like TOP to ~/BA/SOL/top
>export TOP=~/BA/SOL/top


To check the value of environment variable like TOP
>echo $TOP


to flush DNS cache on Linux:
- To restart the nscd daemon, type 
/etc/rc.d/init.d/nscd restart 
in your terminal
- Once you run the command your linux DNS cache will flush.

to rename a file
>mv abc.c abc

>find /opt/CA -name "m_replace" -print

similar to explorer . in windows we can use "nautilus ." without double quotes.

to share files we can go to /mnt/httpd and open it


command to know suse verion on suse linux:
cat /etc/SuSE-release

How to check physical memory in solaris:
/usr/sbin/prtconf -v |grep Memory

Command to Know processid:
pidof processname
example:>pidof abserver
>23434


command to kill a process:
you can try:
>kill processID
>pkill processname
Forcible kill after trying kill with -1 and -2 is
>kill -9 processID
killing multiple instances of same process
>killall processName
>killall -9 processName


To list all processes running along with mem and cpu usage:
>ps aux
example:
>ps aux | grep uniserver
reference link: http://www.linfo.org/ps.html

How to create core file in Linux:
>ulimit -c unlimited
now core file will be generated like core.12345 where 12345 is pid of process. created in the location where process binary exist.
(or )
>gcore process-ID

How to get callstack of running process:
pstack processId
example:
>pstack 21345
This will give same output as gcore command coredump, analyzing it via gdb command
using gdb to get callstack:
>gdb programname core-file
> where //to get call stack
>bt    //to get callstack
>quit   //to come out of gdb

4 comments: (+add yours?)

Unknown said...

Thank you for taking the time to publish this information very useful! I've been looking for books of this nature for a way too long. I'm just glad that I found yours. Looking forward for your next post. Thanks :)

TOSHIBA PLT-1204BT

Anonymous said...

Good post.I referred many resources at the time of my writing.But this post is giving the correct information about the topic so this post is very helpful my writing.You can share any informative post with best essay writing services.Waiting for your next post.

jasonbob said...

nike air max
goyard handbags
adidas gazelle
converse outlet
golden goose sneakers
balenciaga
vans shoes
nike air max 97
kd shoes
adidas yeezy boost

Mike Great said...

Great informative post, I'm very much impressed.
Thank you for sharing such good information. Very useful and impressive post.
Keep it up!

My Interests:
Anycubic 3D Printer

Anycubic photon mono x

Anycubic photon mono fep

Anycubic wash and cure 2.0

Post a Comment

Related Posts with Thumbnails