#navbar { (To hide nav bar in blogger) height: 0px; visibility: hidden; display: none; }

Thursday, May 6, 2010

 

Commands On Commands in Linux

Commands On Commands in Linux
With my knowledge i tried to gather below commands, please share your thoughts/experiences through comments.

1.strace -- very much handy when debugging a command/script which will struck in middle of execution. This command will be tough when you start using it initially, but will come hand when start using excessively. And there are some more sister commands for this ie ltrace mtrace which i never used, please give some inputs on these.

For example if we want to see how ls command is executed and want to see what actually ls command is doing? you can check that out by using strace
#strace ls

2.watch --used to see a command executino at a regular intervels(by default 2 sec)

Some valuable examples

a.Monitoring a copy activity of CD/DVD, which will show the progress.
#cp -ar /dev/cdrom /mnt &
#watch ls -l /mnt

b.Watching who are connecting to a system and disconnecting
#watch lsof -i

3.time --To see how much time a command taken to execute, This a handy tool when you want to check how much time your shell script taken to execute.
#time ls
#time shellscript.sh

4.whereis --to find where a command located
#whereis ls

5.whatis --to get one line info on a command
#whatis ls

And a well known man command and info commands to see the details of a command what it can do.
#man ls
#info ls.

Comments:

Post a Comment

Subscribe to Post Comments [Atom]





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]