Nov 24, 2007

Linux Shell Commands (Tutorial):

Shell commands are commands through which we can operate Linux. Here I am giving commands that how to operate Linux shell. These commands must be typed in small case at Linux shell prompt.

Creating a text file in Linux Shell:

cat > filename


By using above shell command we can easily create a file in Linux OS. You can give any filename of your wish and then press Enter Key and then type some matter (text) for the file and then press CTRL + D from the keyboard to save the file and you are done. You have successfully created a file in Linux.

Displaying Contents of a text file in Linux Shell:

Suppose you want to display contents of any text file in Linux OS, just type the following command at the Linux shell prompt and press Enter (Return) Key.

cat filename

In place of filename you can type any filename that exist in that directory. This will show you whole contents of the file.

Displaying contents of more than one file in one command:

By using following command you can display content of more then one file at a time in a single shell command. Here in this example I am displaying matter of two files at a time.

cat filename1 filename2

Removing a file:

If you no longer need any file then you can easily remove any file from shell to do so type the following command at shell prompt.

rm filename

Making a directory:

If you want to make a directory type the following command at the shell prompt and then press Enter Key.

mkdir directoryname

You can type any directory name as your want.

More Linux Shell Commands

No comments:

Post a Comment