Tuesday, September 25, 2012

Eighth session of Some of basic UNIX commands that are useful very frequently


Today we will discuss about some more useful commands in UNIX/LINUX based operating system.

If you want to see quickly what is the content of a file, then you can use below command to see the content of file in the same terminal you are working currently.

cat filename

Above command will display content of file named 'filename' present in current working directory in the terminal.

cat filename > /x/y.txt

Above command will copies content of file named 'filename' present in current working directory into file named 'y.txt' present in path '/x'.

cat filename1 filename2 > /x/y.txt

Above command will concatenate content of files named 'filename1'and 'filename2' present in current working directory into file named 'y.txt' present in path '/x'.

cat filename1 filename2

Above command will concatenate content of files and displays in the terminal. It doesn't modify original files instead it display both files content into terminal by concatenating.

One more important command that we are going to discuss today is 'ps'.

ps

Above command will display current processes which are running. This command is some what like a 'Task Manager' in windows where as the difference is in task manager we can kill process which we don't want to run but, here we can know process IDs by which we can delete the process using 'kill' command that we can discuss in our next post. This command will display lot of information about processes that are currently running.

ps -u

Above command will display current processes that are running in current log-in.

Please feel free to post your comments/queries. We can discuss some more useful UNIX/LINUX commands in our next post.

No comments: