*******************
execute last particular command
!command
****************************************
it returns the path of that file
find -name "file name"
****************************************
Return the file path but ignore the Case
ex test,Test,TEST
find -iname test
****************************************
find the all others file and skip the given file name(Find
in all dir.)
find -not -name test
****************************************
find in all current Dir..
find -maxdepth 1 -name filenaem
****************************************
find with in 1 level dir
dir 1(test.txt)->dir 11(test.txt)->dir 12(test.txt)
dir 2(test.txt)->dir
find -maxdepth 2 -name test
****************************************
find the file from the Specific Levels of dir
1 level to 4
find -maxdepth 4
-mindepth 1 -name test
****************************************
find file which is modified after the given file name
find -anewer test
****************************************
find all file which is modified last 10 mins
find . -mmin -10
****************************************
find the all which are only Files
$ find . -type f
****************************************
find -mtime -24
will give you last
modified file form
****************************************
find all file which is access in given time
find -atime
****************************************
[linux_demo]mkdir demo
[linux_demo]cd jignesh
[linux_demo dir1]cat >a
this is a from jigensh dir jignesh
[linux_demo dir1]cd ..
[linux_demo]mkdir jigensh1
[linux_demo]dir jignesh
a
[linux_demo]dir jignesh1
dir: jignesh1: No such file or directory
[linux_demo]dir
jigensh1 jignesh
[linux_demo]dir jigensh1
[linux_demo]cp jignesh/a jigensh1/
[linux_demo]cd jigensh1
[mca11134@ALS jigensh1]$ dir
a
/******************************************/
[linux_demo]mkdir jigensh2
[linux_demo]dir
a b d
e jigensh1 jigensh2
jignesh
/******************************************/
cat also just create a null file and you can you also create
like this
cat >a>b>c
file data
ctrl+d
cat c
file data
cat a
null
cat b
null
//putting the data into alerady created file
cat >b
file data
ctlr+d
cat >b
file data
dir o/p =a,b,c
to append the data into the existing file
cat >>a
/******************************************/
rm file1 file2 file3...
rm second third
rm * delete the all files
/******************************************/
who :- Give the list of all connected ip
who am i // prints only information about you
ls :- give th name of user with blue color
ctr+d to exit from the file during the writing
/******************************************/
wc [OPTION]...
[FILE]...
-c, --bytes print the byte counts
-m, --chars print the character counts
-l, --lines print the newline counts
-L,
--max-line-length print the length of
the longest line
-w, --words print the word counts
/******************************************/
mv -u oldfile not_avlbel_fiel
[linux_demo]dir
a b c
d jignesh
[linux_demo]mv -u c e
[linux_demo]dir
a b d
e jignesh
/******************************************/
sort [OPTION]...
[FILE]...
sort -o
destinataion form source
sort -o text1.txt text2.txt
find the string from the file with line no
[linux_demo]grep -e hello test2
hello
[linux_demo]grep -n -e hello test2
2:hello
[linux_demo]grep hello test2
hello
/******************************************/
printing the all afterward context after find the given
stiring
[linux_demo]grep -A
2 hello
test2
hello
HELLO
hellohowru
[linux_demo]grep -w
-A 2 hello test2
hello
HELLO
hellohowru
[linux_demo]grep
-w hello test2
hello
[linux_demo]grep -w
-A 2 hello test2
/******************************************/
search hello word form two file
[linux_demo]grep -w hello test2 test4
test2:hello
test4:hello
/******************************************/
skip the string which is given file
[linux_demo]grep -v this test2
hi
hello
HELLO
hellohowru
/******************************************/
copy file form one to another file
[linux_demo]cat >test4
[linux_demo]cat test2>>test4
[linux_demo]cat test4
hi
hello
HELLO
hellohowru
[linux_demo]cat test2
hi
hello
HELLO
hellohowru
/******************************************/
find the given string form all avalble files
[linux_demo]grep -w hello *
test1:hello
test2:hello
test4:hello
No comments:
Post a Comment
Thank you....
Note: only a member of this blog may post a comment.