Useful Linux Commands

Run command without any output

command > /dev/null 2>&1

Run command in background without any output

nohup command > /dev/null 2>&1 &

List all files

find . -type f -printf "%[email protected] %p\n" | cut -d\  -f2-

Search for specific directory recursively

find . -type d -name my-foo-dir-name

Search string in specific file type recursively

find . -type f -name "*.php" -print0 | xargs -0 grep "my_string" -n --color=auto

 

Tags

Share your thoughts by leaving a comment below.