Linux commands for File location and Properties

Commands for File location:
In this File Location Commands we are able to search for a file in the file system with full path from the root directory and also to locate the files via an index.

find – it is used to search for a file

find / -name file.a it will search from the root directory for the file called file.a

find / -name “file” it will search from the root directory for the file containing the string file

locate- it is used to search the files anywhere in the file system

slocate to locate the files via index

which- It shows the full path of shell command

which grep it show where exactly “grep” command is located on the file system…..like /bin/grep

whereis – it locate the program, source code and manual page for a command

whereis ls to find out where ls and its main page

Commands for file properties:


In this File Properties Commands we can change the permissions of owner file and group file. We can also change the time stamps and count the words, lines and bytes in it.

chown – we can change the file owner

chgrp – we can change the file group

touch – we can change the time stamps

wc – we can count bytes/words/line

0 comments:

Post a Comment