Linux interview questions and Snippets for daily use on Linux :P
Tuesday, December 31, 2013
To copy recent files from a folder to somewhere else:
cp $(ls -lrt | tail -2 |awk '{print $9}') ../ (copying last 2 recent files smwer)
Friday, December 27, 2013
To find a word in a directory lets say err
ls -Rl | grep ^-r | awk '{print $10}' |xargs cat | grep -w import
or
ls -Rl | grep ^-r | awk '{print $10}' |xargs cat | grep '\bimport\b'
Newer Posts
Older Posts
Home
Subscribe to:
Posts (Atom)