Friday, December 23, 2011

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


Hi Folks,

In this i want to share some other UNIX/LINUX command which is useful for us very frequently.

To display list of files,directories that are available in current directly please run below command.

'ls'

If you want to see more options that are available for this command then you can run below command

ls -a - This option is used to display hidden files along with normal files.

ls -l - This option displays full details of all files and folders present in current directory. For example see below sample output of this command.

drwxr-xr-x 2 user group 4096 2011-01-06 12:06 Public
In this output, highlighted part consists total 10 fields which includes of below information:
d - means its a directory.(If it is file then this will be blank).
r - read permission for user,group,others.
w - write permission for user,group,others.
x - execute permission for user,group,others.
So, first 'rwx' means this file has all permissions for user. Next 'r-x' means this file has only read and execute permissions for group. Next 'r-x' means this file has only read and execute permissions for others.

ls -d */ - This option shows only folders present in current directory.

ls -s - This option shows files and folders present in current directory along with their sizes in blocks.

ls -lt - This option shows files in the order of their last modified time.

pwd - This option shows present working directory.

Please try these when you are free. In our next session we can discuss some other commands.

1 comment:

Unknown said...

Appriciate your effort to fetch Really a good information regarding the Unix, Please find details of more unix commans at http://www.tekhnologia.com/2011/05/learn-daily-used-unix-command.html

Really useful link to get details regarding Unix commands.