Friday, August 17, 2018

echo,GREP, PS and Redirection

grep "1" DELME -- search for string "1" in file DELME and output the line matching this.

Ex: grep "h" uday.txt
-----------------
hi there busy
hello

echo "hello there" | grep "there"
hello there

echo-- prints to console

redirection:(>)
----------------
echo "Hi boss" > file.c
>> for appending to existing file, if not creates a new file.

ps: all processes running by the current user.
whoami : current user
ps -ef : enumerated full form,provides processes running by other users also.

ps -ef | grep $USER (or) username directly.
lists only created by the specified user, with full details.

No comments:

Post a Comment