Tuesday, February 19, 2013

Arguments with basic terminal commands



1.find

a. find . -iname "filetofind" 
i= search case insensitively
name= search by name
The portion indicated by double inverted commas is the file you need to find.
. (dot) refers to current directory

b. If you need to find file that are accessed  in time interval within 1 day.

 find . -iname "*" -atime -1

* are wild cards they can replace any keyword or name you want to find

c. If you need to find files that are modified in time interval less than 1 day.

find . -iname "*" -mtime -1

mtime= modify time

2. rm filename

a. rm filename (use this command to remove file)
b. rm -r filename (use this command to remove directory)
Since we cant remove directories simply,  so using argument -r with rm removes file recursively.

3. mv filename 

a. mv filename ./Desktop 
for full details of mv command refer here



No comments:

Post a Comment