Do you know what dmidecode command will do?
Ans : Are you going to search in google about dmidecode? No need to search boss. No need to go any where. Linux provied many help tools to know more about a command. This post is all about these commands they are as follows.
1.info command
2. man command
3. --help option
4. whatis command
5. whereis command
First command in this list is info
1. info command(Information command) :
info is a good command which will describe all about the command in detail. Its like lots and lots of pages of information will be there for a single command.
Example :
info ls
The above command will show full help about ls command which is of 10 pages. This will give full information.
2. man command(manual command)
This will give little bit less descriptive but will provied information which you require, and most of the times each option of a command will be described in one sentence and some times in paragraphs.
Example :
man ls
3. --help option
This option is to give one line discription to each option of the command
Example :
ls --help
Please remember --help may present or not present to a command.
4. whatis command
This will show one line description to a give command,
whatis ls
Last but not least
5. whereis this is not a help command but i feel describing this here. This command will show the location of any command.
whereis ls
All About info, man, whatis, whereis, --help Commands
0 comments 4/19/2010 10:26:00 AM Posted by Meghana M BhombhoreLabels: Basic-Commands
Commands On Commands
0 comments 1/18/2010 07:14:00 PM Posted by Surendra Kumar AnneLabels: Basic-Commands, Basics, How-To's
I thought of writing a post on some good comamnds which are capable of running on other commands.
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
BASH_History_Capabalities
2 comments 12/05/2009 08:29:00 AM Posted by Meghana M BhombhoreLabels: Basic-Commands, Basics
Though this is a basic topic known to many of you, But I want to share so that some one will get new things.
BASH(Broune Again Shell) is the default shell in Linux, which will act as a communicator between Kernel and user. Its having so many capabilities such as
a.Short cuts
b.Command chaining
c.History
As I mention we will see all about BASH shell history capabilities here. And I have divided this BASH capabilities in to three parts like basics, medium and advanced.
Basic capabilities of BASH History:
1.To see all the commands what we executed previously
#history
2.To check the history size of your system
#echo $HISTSIZE
3.To check where is your history file, which stores all your previous commands
#echo $HISTFILE
4.To browse history.
Just press up/down arrow to browse history
5.To see all the commands which have particular word
#history | grep string
Example:
#history | grep cd
Medium capabilities of Bash history:
6.Some times browsing history is very tedious job and some times we are executing some big big commands so there is a capability in Bash to over come this ie search-i-reverse. For doing this press ctrl+r and type a string in previous command which you want to execute.
Lets see it with an example
root@krishna-laptop:~#(reverse-i-search)`se': service winbind restart
if you see above I just pressed ctrl+r and then started to type se, it is showing service winbind restart command, so I no need to type entire command and I have to justent press enter
root@krishna-laptop:~# service winbind restart
* Stopping the Winbind daemon winbind [ OK ]
* Starting the Winbind daemon winbind [ OK ]
root@krishna-laptop:~#
7.Changing the size of history. Most of the Linux machines by default it can store up to 500 previously executed commands. Some people likes to change it to some value, here i want to keep my previously executed 3000 commands.
#HISTSIZE=3000
8.to execute previous command
#!!
or
!-1
9.To execute 25 command in bash history
#!25
10.To execute a recent command which start with a string
#!string
11.To clear all the history
#HISTSIZE=0
or
#history –c
12.In Linux when we execute some command there will be no output of the command, for example useradd or mount -a commands will not give you output saying that command is executed successfully or not at that time we can used the below command to see whether the previous command is executed successfully or not
#echo $?
If the out put of the above command is "0", that indicates previous command executed successfully, for any other values the command is not executed successfully(total there are 256 values, 0-255).
Advanced capabilities of Bash history:
History Modifiersreferences:
http://linux.about.com/od/commands/l/blcmdl3_history.htm
http://www.linuxtopia.org/online_books/redhat_linux_debugging_with_gdb/using-history-interactively.html
http://docstore.mik.ua/orelly/linux/lnut/ch08_06.htm
http://www.catonmat.net/blog/the-definitive-guide-to-bash-command-line-history/
Please comment your thoughts regarding this post:-)
FILE'S and FOLDER'S Part-2
0 comments 8/12/2009 02:20:00 AM Posted by Surendra Kumar AnneLabels: Basic-Commands, Basics, How-To's, Tutorials
FILES & FOLDERS PART-II
CREATING FOLDERS :
Cmd4a : Creating a single folder.
Example :
#mkdir test
Cmd4b : Creating multiple folders at a time
#mkdir 1{1,2,3}
This command will create folders with name 11,12,13. You can see weather this folders are created or not by using ls or dir command.
Cmd4c : Creating multiple directories and sub directories at a time. This is very much advanced and very much useful command. Some times we have to create a directory structure with sub directories in it. Which are not exist before.
For example I want to create the directory structure as below
/test
/ \
/ \
/ \
user1 user2
/ \ / \
/ \ / \
/ \ / \
apple goa pine tom
So if I want to create these many folders at a time i have to execute the following commands.
First i have to create test directory, then I have to change the directory to it and the create two more directories as user1 and user2 and so on as below.
#mkdir test
#cd test
#mkdir user1
#mkdir user2
#cd user1
#mkdir apple
#mkdir goa
#cd ..
#cd user2
#mkdir pine
#mkdir tom
So you see these many commands i have to execute to create that directory structure. But in linux, its very much easy if you know this option with mkdir command. Execute the mkdir command with -p option it will create subdirectories though they didnt exist.
#mkdir -p test/{user1/{apple,goa}, user2/{pine,tom}}
Thats it you are done. This will create all the folders and sub folders.
Plese visit for remaining posts on files and folders operations..
Labels: Basic-Commands, Basics, How-To's, Tutorials
Cmd1 : Use touch command to create empty file's
#touch test
#touch {1,2,3}{4,5,6}
The above command will create files with 14,15,16,24,25,26,34,35,36 as names by using this you can create n number of files at a time.
For checking weather your files/folders are created you can use ls command.
Please check linuxnix.com for updates.
Cmd2 : Creating files using cat command in combination of output redirecting operator(>)
#cat > filename
Once enter this command you have to enter the content of the file and once you finish it just press Ctrl+d this will save the file. Use again ls command to display the files created.
Cmd3 : Creating a file with any editor(either VI,emacs etc)
#vi filename
Once you execute this command the file will be opened and in order to enter any data we have to first press i to go in to insert mode. Once you type the content in to the file just press esc and :wq to save and quit the file.
Have look at other related posts too.
Get the basic Linux book
0 comments 7/02/2009 07:47:00 PM Posted by Surendra Kumar AnneLabels: Basic-Commands, Basics
This post is for the beginners who want's to start learning linux, which contains
- Introduction
- Shell Tips
- Help
- Re-directing operators
- Basic file system
- System monitoring
- Disk management
- User management
- Text Editors
- Mathematical tools
- Network Management
- Security
- Backup/Restore
- Scheduling
Get the book here.


